|
|
вернуться в форумWat is wrong in my program Послано mihran 22 окт 2007 22:27 # include <string.h> # include <iostream.h> int main() { char a[100][30]; int N,i,j,k,h; cin>>N; if (0<=N && 100>=N) { for (i=0;i<N;i++) cin >>a[i]; for (i=0;i<N;i++) { k=0; for (j=0;j<N;j++) { if (strcmp(a[i],a[j])==0) k++; } if (k>=2) { h=0; for(j=0;j<i;j++) { if(strcmp(a[i],a[j])!=0) h++; } if (h==i) cout<< a[i]<<endl; } } } return 0; } Re: Wat is wrong in my program char a[100][30]; - here is your mistake i change it to char a[128][32]; and I got AC Re: Wat is wrong in my program Послано aditya 3 июн 2009 01:31 Thanks Boss, I changed from char a[100][30] to char a[128][32] and now i got accepted. Can u explain the reason for it. Re: Wat is wrong in my program in the end of string is two system Edited by author 17.04.2010 21:41 Edited by author 17.04.2010 21:41 |
|
|