如果合法,显示"welcome to use the software",否则要求重新输入,允许输入3次,若3次都错,显示“password error!you can not use software".
2 通过strcmp函数,判断是否相同。如相同,则合法。
3 给出提示信息。
说明:strcmp原型为
int strcmp(char *a, char *b);
功能为比较a和b两个字符串,如果相同返回0;如果a大返回1;如果b大返回-1。
大小依照ascii比较。
参考代码如下:
#include <stdio.h>