fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main()
  4. {
  5. char str[105];
  6. char conj[6][5]={"the","a","an","of","for","and"};
  7. char word[30];
  8. char c;
  9. char acronym[30];
  10. int i,j,k,j1,j2,len,flag;
  11. int cas;
  12. int sum;
  13. // freopen("1.in","r",stdin);
  14. // freopen("1.out","w",stdout);
  15. scanf("%d",&cas);
  16. for(j=0;j<cas;j++)
  17. {
  18. sum=0;
  19. gets(str);
  20. k=0;
  21. flag=0;
  22. len=strlen(str);
  23. for(i=0;i<len;i++)
  24. {
  25. c=str[i];
  26. if(c==' ') flag=0;
  27. else
  28. if(flag==0)
  29. {
  30. flag=1;
  31. j1=i;
  32. }
  33. else
  34. if(str[i+1]==' '||str[i+1]=='\0')
  35. {
  36. j2=i;
  37. strncpy(word,&str[j1],j2-j1+1);
  38. word[j2-j1+1]='\0';
  39. int m=0;
  40. while(strcmp(conj[m],strlwr(word))!=0&&m<6) m++;
  41. if(m>5)
  42. {
  43. sum++;
  44. acronym[k++]=str[j1];
  45. }
  46. }
  47. }
  48. printf("case #%d:\n",j);
  49. printf("%d\n",sum);
  50. }
  51. return 0;
  52. }
  53.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
10
United States of America
PEOPLE'S REPUBLIC OF CHINA
Organization of the Petroleum Exporting Countries
United Nation Educational Scientific and Culture Organization
American Standard Code for Information Interchange
China Certification Committee for Environment Labelling Production
Commission of Graduates of Foreign Nuring Schools
International Coordinating Committeefor World Organizations of Sports for the Disabled
International Committee of the Red Cross
A plan the orgnrthr of end this is an elephant did you for big the dsajjkh dagjfkjgh adgjkdfj cnbm
compilation info
prog.cob:1: Warning: Invalid indicator 'i' at column 7
prog.cob:8: Warning: Invalid indicator 'a' at column 7
prog.cob:3: Error: syntax error, unexpected IN, expecting PROGRAM_ID
stdout
Standard output is empty