统计单词
Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)
C-sources:
1 #include <stdio.h> 2 #include <string.h> 3 #define N 100 4 int main() 5 { 6 int n,i,p,q,j,k,wordnum; 7 char ch,temp; 8 9 10 printf("Please input a n number: "); 11 scanf("%d%c",&n,&temp); 12 13 14 char **str=new char *[n]; 15 for(i=0;i<n;i++) 16 str[i]=new char[N]; 17 18 19 20 printf("Please input n strings: "); 21 for(p=0;p<n;p++) 22 { 23 q=0; 24 while((ch=getchar())!=' ') 25 { 26 str[p][q]=ch; 27 q++; 28 } 29 } 30 31 32 for(j=0;j<n;j++) 33 { 34 k=0; 35 wordnum=0; 36 while(str[j][k]!='