online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include<iostream> #include<string> using namespace std; int main() { int A, B, C, D, E ; string code; cout << "Enter a sequence of bits: "; cin >> code; int i = 0; while (i+1 < code.length()) { if( code[i]== '1' && code[i + 1]== '1' ) { cout << 'A'; i += 2; } else if ( code[i]== '1' && code[i + 1]== '0') { cout << 'B'; i += 2; } else if ( code[i]== '0' && code[i + 1]== '1') { cout << 'C'; i += 2; } else if (i+2 < code.length()) { if (code[i]== '0' && code[i + 1]== '0' && code[ i + 2]== '1') { cout << 'D'; i += 3; } else if ( code[i]== '0' && code[i + 1]== '0' && code[ i + 2]== '0') { cout << 'E'; i += 3; } else { return 1; } } else { return 1; } } if (i < code.length()) { return 1; } cout << endl; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue