c初学者
B52 2002-03-26 12:51:04
#include<conio.h>
main()
{
int i;
char a[10][20]={{"caobiao"},{"zhaochaoyue"},{"baiyungui"},{"zhoufeilong"},{"yanghuating"},{"dingxingdian "},{"mahaisheng"},{"liujianjun"}};
int m=1;
char number[20];
int b[10]={97,67,56,89,87,97,65,59,78,95};
char c;clrscr();
while(m==1)
{
printf("Input the name to look for:");
scanf("%s",number);
for(i=0;i<=9;i++)
{
if(strcmp(number,a[i])==0)
{
if(b[i]<60)
{
printf("\n find %s,the score is %d ,you don't pass the test\n ",a[i],b[i]);
goto xx;
}
else if(b[i]<70)
{
printf("\n find %s the score is %d,you shoule study hard\n",a[i],b[i]);
goto xx;
}
else if(b[i]<80)
{
printf("\n find %s the score is %d,you are a midden student\n",a[i],b[i]);
goto xx;
}
else if(b[i]<100)
{
printf("\n find %s the score is %d,do well!\n",a[i],b[i]);
goto xx;
}
}
}
printf("sorry!not found!");
xx: printf("continue or not[y/n]?");
c=getch();
if(c=='n')m=0;
}
}