NUN_BE

|
分享:
▲
▼
#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { char a[1000][1000]; char temp[1000]; int i,x,y,z,sum=2,stop; for(i=0;stop!=2;i++) { printf("请任意输入字串:"); scanf("%s",&a); printf("请问您是否继续输入?要=1 不要=2:"); scanf("%d",&stop); } for(x=0;x<=i-2;x++) { for(y=x+1;y<=i-1;y++) { if(strcmp(a[x],a[y])>0) { strcpy(temp,a[x]); strcpy(a[x],a[y]); strcpy(a[y],temp); } } } for(z=0;z<i-1;z++) { if(strcmp(a[z],a[z+1])==0) { sum++; } else { printf("%s %d\n",a[z],sum); sum=1; } } system("pause"); } 这是我打的= = 但是字串跟数字都怪怪的 输不出来= = 明天要交作业ㄌ= = ㄏㄏ... 可以帮我错的改一改嚜= = 拜托 大大们= =
|