输入10个字符,如果全都是大写字母,输出
perfect;如果全是小写字母输出 good;如果全是数
宇,输出nice,如果前三种情况都不满足输出ok
你的代码贴出来啊
参考我写的
#include <stdio.h>
#include <ctype.h>
int main()
{
int i, n, u = 0, l = 0, d = 0;
char c;
for (i = 0; i < 10; i++)
{
c = getchar();
if (isupper(c)) u++;
if (islower(c)) l++;
if (isdigit(c)) d++;
}
if (u == 10) printf("perfect");
else if (l == 10) printf("good");
else if (d == 10) printf("nice");
else printf("ok");
return 0;
}