prog.cpp: In function 'int main()':
prog.cpp:8:22: error: 'scanf' was not declared in this scope
for(; scanf("%d",&x) > 0 && x != 42; printf("%d\n", x));
^
prog.cpp:8:56: error: 'printf' was not declared in this scope
for(; scanf("%d",&x) > 0 && x != 42; printf("%d\n", x));
^