#include using namespace std; int main() { int n; while (true) { cin >> n; if (n != 42) { cout << n << endl; } else { break; } } }
I checked my code with a variety of inputs and it turns out to be right but after submission they says failed.
You had WA,Compilation Error, and then AC, so I guess you resolved your problem.