好久没用C语言了.
#include <stdio.h> int main(int argc, const char * argv[]) { int sum; int run; int toAdd; sum=0; run=0; toAdd=0; while(1){ run=run+1; toAdd=toAdd*10+1; sum=sum+toAdd; if(run==4){ break; } } printf("THE RESULT IS: %d
",sum); return 0; }