用:
scanf("%c\n",choose);
应当就行了。
#include "stdio.h"
void main()
{
int i,j,num=0;
char choose;
char s[50][20];
printf("input\n");
for(i=0;i<50;i++)
{
j=0;
do{
s[i][j]=getchar();
j++;
}
while(s[i][j-1]!='\n');
num++;
printf("Do you want to go on y ore n:");
choose=getchar();
getchar();
if(choose!='y') break;
}
for(i=0;i<num;i++){
printf("******the %d th person is:",i);
for(j=0;j<20&&s[i][j]!='\n';j++)putchar(s[i][j]);
printf("******\n");
}
}
我调过了这样就可以