#include<time.h>
#include<stdlib.h>int main()
{
int i,j,count1=0,count2=0,c=1
char ch[100],data[100]
srand(time(NULL))
for(i=0i<100i++)
{
j = rand()%52 + 0
if(j<26)
{
c = 2
ch[i] = j + 'A'
}
else
ch[i] = j + 'A' + 6
}
if(c == 1)
{
printf("等级为1\n")
for(i=0i<100i++)
printf("%c",ch[i])
}
else
{
printf("等级为2\n")
for(i=0i<100i++)
printf("%c",ch[i])
}
printf("\n")
for(i =0i<100i++)
{
scanf("%c",&data[i])
}
for(i=0i<100i++)
{
if(data[i] == ch[i])
{
printf("%c",data[i])
count1++
}
else
{
printf("*")
count2++
}
}
printf("\n")
printf("对了%d个\n",count1)
printf("错了%d个\n",count2)
return 1
}数字可以自己改的!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)