diff --git a/pixel.cpp b/pixel.cpp index bbafce1f3a045a8508aa1cef9b3c9d8951f4bfc6..07197bb8480195e1c06983d2bd4f7209240c5a94 100644 --- a/pixel.cpp +++ b/pixel.cpp @@ -78,4 +78,13 @@ long long toAscii(int c) { return bin; } - +int convertBinInt(long long n) { + int dec = 0, i = 0, rem; + while (n != 0) { + rem = n % 10; + n /= 10; + dec += rem * pow(2, i); + ++i; + } + return dec; +}