online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> const int GAP = 100; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int cnt = 0; char str[2002]; char c; int i, len; while (scanf("%c", &c) != -1) { str[cnt] = c; cnt++; if (cnt % GAP == 0) { if (str[cnt - 1] == ' ') continue; len = 1; // number of space will be added while (len < GAP && str[cnt - 1 - len] != ' ') len++; if (len == GAP) continue; // move len character forward, start from cnt - len for (i = cnt - len; i < cnt; i++) { str[i + len] = str[i]; str[i] = ' '; } cnt += len; } } str[cnt] = 0; printf("%s", str); 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