#include <stdio.h>
int main(void) {
// your code here
int n;
while(1)
{
scanf("%d",&n);
if(n==42)
break;
else printf("%d",n);
}
return 0;
}
created
last reply
- 6
replies
- 1.4k
views
- 4
users
- 1
link
#include <stdio.h>
int main(void) {
// your code here
int n;
while(1)
{
scanf("%d",&n);
if(n==42)
break;
else printf("%d",n);
}
return 0;
}
Maybe the question shouldn’t be “What is problem in my code?” but “How to test my code?”. When testing on console by “hand”, it’s hard to find difference [error]. I think that @code_071096 do it in that way, testing on console…
Yes, you are right. Error is obvious for experiend user, for you, or for me, even without testing, but what about beginner[s]?
BTW
On the other hand, shoudn’t the user tell as that his problem gone out? : http://www.spoj.com/status/TEST,code_071096/70