|
|
back to boardAbout input. Posted by Lifanov 14 Apr 2005 08:36 this test correct 2 a b c234 b c d and 1 a b b I think i have problem with read data while(n){ n--; gets(s); if(s[0]==0){ n++; continue;//empry line } // printf("%s\n",s); i=0; for(j=0;j<3;j++){ sscanf(&(s[i]),"%s",name); correct(name); team[n][j]=addname(name); i+=strlen(name); while(!(s[i]>='a' && s[i]<='z') && j<3) i++; } } /find the first not small latin letter void correct(char *s){ int n=strlen(s); int j=0; for(int i=0;i<n;i++){ if((s[i]>='a')&&(s[i]<='z')){ s[j]=s[i]; j++; } else{ s[j]=0; return ; } } } I get WA 5. i did not know C++ Posted by famas 14 Apr 2005 09:43 1 a b b Cannot be, as in a team of 3 different persons. some test: 1 2 3 4 5 1 9 10 6 8 7 11 4 13 15 17 20 3 8 15 16 9 13 10 answer: 4 1 2 3 1 4 5 6 7 1 answer: 1 |
|
|