例:
乔治50 40
石灰30 20
卡伦10 60
do {
printf("\nInput player name:[1..10] ");
fgets(name,10,stdin);
}
Run Code Online (Sandbox Code Playgroud)
输入名称:青柠
然后,该文本文件将是:
乔治50 40
卡伦10 60
我该怎么做才能使它保持循环,直到它至少有一个大写,小写和数字?
我卡住了,真的卡住了......
char password[100][15];
i=1;
printf("Password [3..10]: ");
gets(password[i]);
while (strlen(password[i])>10 || strlen(password[i])<3 || ) {
do{
printf(" Password must contain at least 1 uppercase, 1 lowercase, and 1 number\nPassword [3..10]: ");
gets(password[i]);
} while (strlen(password[i])>10 || strlen(password[i])<3 );
Run Code Online (Sandbox Code Playgroud)