|
|
back to boardWhat's wrong with my program? Posted by nut_nic 24 Sep 2004 23:36 I got Wrong Answer #1 what is it? #include <stdio.h> main(){ unsigned long t[100],s[100]; int ct,cs,c,c2,a; a=0; scanf("%i",&ct); for(c=0;c<ct;c++){ t[c]=0; scanf("%ld",&t[c]); } scanf("%i",&cs); for(c2=0;c2<cs;c2++){ s[c2]=0; scanf("%ld",&s[c2]); } for(c=0;c<cs;c++){ for(c2=0;c2<ct;c2++){ if(t[c2]==s[c]){ a++; } } } printf("%i",a); return 0; } in C language. Re: What's wrong with my program? The limit is too small you shuold put unsigned long |
|
|