在登录一些网站或者游戏时, 都需要注册用户名。在注册时,是不可以注册已存在的用户名的。

#include <stdio.h>
#include <conio.h>
#include <string.h>


int main(int argc, char * argv[])
{
    char name[20], user[] = "pythonschool";
    int sex;
    printf("请输入用户名:\n");
    scanf("%s", name);
    char * str = (strcmp(name, user))?"不存在":"已存在";
    printf("用户名:   %s \n", str);
    getch();

    return 0;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-11-22
猜你喜欢
  • 2021-05-25
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2022-01-21
  • 2021-12-01
相关资源
相似解决方案