题解 | #登录验证#
登录验证
http://www.nowcoder.com/practice/799daf76369c4fb1a2e2d56f885225ae
#include <stdio.h> #include <string.h> int main() { char name[30] = "0",mima[30]="0"; while (scanf("%s %s",name,mima)!=EOF) //因为这个用gets,编译不通过,所以用了两个数组 { if((strcmp(name,"admin")==0)&&strcmp(mima,"admin")==0) printf("Login Success!\n"); else printf("Login Fail!\n"); } return 0; }