高手请进,谢谢啦
帮我找出这个程序的错误,万急!(要用TC)int n,i=0,j,k=0,resu;
char s1[100],s2[100], s[100];
#include "stdio.h"
void main()
{void cpy(char str1[],char str2[]);
char s1[100],s2[100];
/*Print Welcome screen and the main interface*/
printf("\n\n");
printf("a w eeeeeee l ccccccc ooooo mmmmmmmmm eeeeeee !!!!\n");
printf("w w w e e l c o o m m m e e !!! \n");
printf(" w w w w e eeeee l c o o m m m eeeeeee !! \n");
printf(" w w w w e l c o o m m m e ! \n");
printf(" w w eeeeeee llllll ccccccc ooooo m m m eeeeeee \n");
for(;;)
{
int sum=0;
printf("\n");
printf("\t****************MENU*******************************\n");
printf("\t* Common Algorithm String *\n");
printf("\t* 1.Copy string *\n");
printf("\t* strings *\n");
printf("\t* 3.Request the length of the string *\n");
printf("\t* 4.Connect the two strings *\n");
printf("\t* 5.The character ch converted to lower case mother *\n");
printf("\t* 6.The character ch converted to upper case letters *\n");
printf("\t* 7.Check if the letters ch *\n");
printf("\t* 8.Check whether the number of ch *\n");
printf("\t* 9.Ch check whether the letters or numbers *\n");
printf("\t* 10.Check whether ch capital letters (A - Z) *\n");
printf("\t* 11.Check whether ch lowercase letters (a - z) *\n");
printf("\t* 12.Quit *\n");
printf("\t***************************************************\n");
printf("\nPlease choose the number n:");
scanf("%d",&n);
while (n<=0||n>13)
{
printf("Please choose the number again n:");
scanf("%d",&n);
}
switch( n)
{
case 1: /*字符串的复制*/
clrscr();
getchar(); /*抵消回车*/
printf("input string1:");
gets(s1);
j=0;
for (i=0;s1[i]!='\0';i++) s2[i]=s1[i];
printf("\nThe new string is:%s\n", s2);
break;
case 2:
clrscr();
getchar(); /*字符串的比较 */
printf("\ninput string1:");
gets(s1);
printf("\ninput string2:");
gets(s2);
i=0;
while ((s1[i]==s2[i])&&(s1[i]!='\0'))i++;
if (s1[i]=='\0'&& s2[i]=='\0') resu =0;
else
resu=s1[i]-s2[i];
if(resu==0)
printf("s1=s2");
else if(resu>0)
printf("s1>s2");
else
printf("s1<s2");
break;
case 3:
clrscr();
getchar(); /*求字符串的长度 */
printf("\ninput string:");
gets(s);
for(i=0;s[i]!='\0';i++)
sum=sum+1;
printf("The length of the string is:%d", sum);
break;
case 4:
clrscr();
j=0;
i=0;
getchar(); /*连接两个字符*/
printf("\nput string1:");
gets(s1);
printf("input string2:");
gets(s2);
while(s1[i]!='\0')
i++;
while(s2[j]!='\0')
s1[i++]=s2[j++];
s1[i]='\0';
printf("the new string is:%s\n",s1);
break;
case 5:
clrscr();
printf("input string:"); /*将ch字符转换为小写母*/
getchar();
gets(s);
for(i=0;s[i]!='\0';i++)
if(s[i]>=65 && s[i]<=90)
printf("%c",s[i]);
else if(s[i]>=97 && s[i]<=122)
{s[i]=s[i]-32;
printf("%c",s[i]);
}
else
printf("%c",s[i]);
break;
case 6:
clrscr();
getchar();
printf("input string:"); /*将ch字符转换为大写字母 */
gets(s);
for(i=0;s[i]!='\0';i++)
if(s[i]>=97 && s[i]<=122)
printf("%c",s[i]);
else if(s[i]>=65 && s[i]<=90)
{s[i]=s[i]+32;
printf("%c",s[i]);
}
else
printf("%c",s[i]);
break;
case 7:
clrscr();
getchar(); /*检查ch是否是字母 */
printf("input string :");
gets(s);
for(i=0;s[i]!='\0';i++)
{
if( (s[i]>=65 && s[i]<=90) || (s[i]>=97 && s[i]<=122)||(s[i]==' '))
continue;
else
k=1;
}
if(k==0)
printf("The string is alpha.");
else
printf("The string is not alpha.");
break;
case 8:
clrscr();
getchar(); /*检查ch是否是数字 */
printf("input string :");
gets(s);
for(i=0;s[i]!='\0';i++)
{if( (s[i]>=48 && s[i]<=57) || (s[i]==' '))
continue;
else
k=1;}
if(k==0)
printf("The string is numeric.");
else
printf("The string is not numeric.");
break;
case 9: /* 检查ch是否由字母或数字组成 */
clrscr();
k=0;
getchar();
printf("input string :");
gets(s);
for(i=0;s[i]!='\0';i++)
{
if((s[i]>=65 && s[i]<=90) || (s[i]>=97 && s[i]<=122)||(s[i]==' ')|| (s[i]>=48 && s[i]<=57) )
continue;
k=1;}
if(k==0)
printf("The string is numeric or alpha .");
else
printf("The string is not numeric or alpha.");
break;
case 10: /*检查ch是否大写字母(A——Z)*/
clrscr();
getchar();
printf("input string :");
gets(s);
for(i=0;s[i]!='\0';i++)
{
if( (s[i]>=65 && s[i]<=90) ||(s[i]==' '))
continue;
else
k=1;
}
if(k==0)
printf("The string is capital letter.");
else
printf("The string is not capital letter.");
break;
case 11:
clrscr();
getchar();
printf("input string :");
gets(s);
for(i=0;s[i]!='\0';i++)
{
if( (s[i]>=97 && s[i]<=122) ||(s[i]==' '))
continue;
else
k=1;
}
if(k==0)
printf("The string is small letter.");
else
printf("The string is not small letter.");
break;
case 12:
clrscr(); /*退出界面*/
printf("\n");
printf("\tBBBBB Y Y BBBBB !!!!! \n");
printf("\tB B Y Y B B !!!! \n");
printf("\tBBBBB Y BBBB !!! \n");
printf("\tB B Y B B !! \n");
printf("\tBBBBB Y BBBBB ! \n");
}
}
}