为什么这个程序不能一直运行呢
do {
printf("please input a choice,o to input data,s to sort,e to exit:\n");
scanf("%c",&ch);
switch (ch)
{
case 'e':printf("the process is over,goobye.");
break;
case 'o':
for (i = 0; i < 10; ++i)
{
printf("Please enter the data,if you want to end the input process, please input #:");
scanf("%s", &str[i]);
if (strcmp(str[i], "#") == 0)
{
k = i;
break;
}
}
break;
case 's':
for (i = 0; i < k; ++i)
{
for (j = i + 1; j < k; ++j)
{
if (strcmp(str[i], str[j]) > 0)
strcpy(str[i], str[j]);
}
}
printf("the sort data:\n");
for (i = 0; i < k; ++i)
{
printf("%s\n", str[i]);
}
break;
}
}while (strcmp(ch , "o")==0 || strcmp(ch , "e")==0);