The tutorial problem used cstdio I/O...I tried posting my first solution before reading it, using cout/cin and it said Compile Error. So why are we forced to use cstdio in C++?
Iostream works fine, try it yourself for e.g.http://www.spoj.com/status/TEST,daft_wullie/
#include <iostream> using namespace std; int main(){ int a; cin >> a; while (a != 42) { cout << a << endl; cin >> a; } return 0; }