题解 | 登录验证
#include <stdio.h> #include <string.h> int main() { char username[50], password[50]; while (scanf("%s %s", username, password) != EOF) { if (strcmp(username, "admin") == 0 && strcmp(password, "admin") == 0) { printf("Login Success!\n"); } else { printf("Login Fail!\n"); } } return 0; }