TGViewer
Binary Squad Binary Squad @binary_squad · 72 subscribers
Post #29 61
11011000 10110001 11011001 10001000 11011000 10110010 11011000 10101010 11011001 10001000 11011001 10000110 00100000 11011001 10000101 11011000 10101000 11011000 10100111 11011000 10110001 11011010 10101001 00100000 11011000 10101000 11011000 10110001 11011001 10000110 11011000 10100111 11011001 10000101 11011001 10000111 00100000 11011001 10000110 11011001 10001000 11011011 10001100 11011000 10110011 00100000 11011001 10000111 11011000 10100111 11011011 10001100 00100000 11011000 10101010 11011000 10100111 11011000 10110010 11011001 10000111 00100000 11011010 10101001 11011000 10100111 11011000 10110001

#include <iostream>
#include <string>

using namespace std;

unsigned char toDecimal(string binary) {
unsigned char number = 0;

for (int i = 0; i < 8; i++) {
number = number * 2 + (binary[i] - '0');
}

return number;
}

int main() {
string binary;
string text;

cout << "Binary: ";
getline(cin, binary);

string byte = "";

for (char c : binary) {

if (c == '0' || c == '1') {
byte += c;

if (byte.length() == 8) {
unsigned char decimal = toDecimal(byte);
text += decimal;

byte = "";
}
}
}

cout << "Text: " << text << endl;

return 0;
}


💻 @Montakhab_Comp | @Binary_squad
  • 👾 9
More from @binary_squad
  1. Sep 13, 2026🚀 خب، ترم‌چین دقیقاً چه کار می‌کنه؟ 📥 درس‌هات رو وارد کن گزارش ۲۱۲ گلستان رو به ترم‌چین…
  2. Aug 28, 2026📘 درک الگوریتم‌ها | Grokking Algorithms اگر الگوریتم‌ها همیشه برات پیچیده و خشک به نظر می…
  3. Aug 7, 2026وقتی Ping شد پس هنوز connection هست ، ادامه بده #mtv 💻 @Binary_Squad
  4. Jul 25, 2026باینری این بار در اینستاگرام و اولین پست ما : https://www.instagram.com/reel/DbNeyU0otal ح…
  5. Jul 24, 2026به پایان آمد این دفتر ، حکایت همچنان باقیست و این هم از پایان اینیت. ما در این پادکست سعی…
  6. Jul 22, 2026انجمن علمی برنامه‌نویسی دانشگاه تربیت دبیر شهید رجایی تقدیم می‌کند: 🎙 سلسله پادکست‌های وی…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →