Hello friends,
Im new to spoj and im trying to figure why my code is wrong, i searched the forum but nothing matched my problem.
It works on my compiler, but all i get from the online judge is wrong code.
Could you guys help me with this problem?
#include <stdio.h>
int main(){
int input[5];
int output[5];
int i, j;
for(i = 0; i < 5; i++){
scanf("%i", &input[i]);
}
printf("\n");
for(j = 0; j < 5;j++){
if(input[j]==42){
printf("%d\n", input[j] );
break;
} else{
printf("%d\n", input[j]);
}
}
return 0;
}
created
last reply
- 14
replies
- 3.7k
views
- 12
users
- 4
links