C语言精简代码

时间:2025-09-11 19:49:33 C语言

C语言精简代码

  知道C语言精简代码是怎么样的吗?下面小编为大家整理了C语言精简代码,希望能帮到大家!

  模拟银行输入密码的源码

  #include

  #include

  int main()

  {

  int pass,i=0,p=5;

  /pic/p>

  printf("请注意周边环境,再输入密码: ");

  while(pass!=123456)/pic/p>

  {

  scanf("%d",&pass);/pic/p>

  if(pass!=123456)

  printf("输入密码错误%d次... ",++i);

  if(i>=3)/pic/p>

  {

  printf("对不起,你的卡被取款机吃了,请联系银行... ");

  while(i==3&&p>=0)/pic/p>

  {

  printf(" %d秒退出系统...",p--);

  Sleep(1000);

  }

  return -1;

  }

  }

  if(pass==123456)/pic/p>

  {

  printf("密码正确,进入系统中... ");

  while(p>=0)

  {

  printf(" %d秒进入系统...",p--);

  Sleep(1000);/觉一秒钟1秒=1000毫秒

  }

  }

  return 0;

  }


【C语言精简代码】相关文章:

C语言的预处理代码03-15

C语言快速排序实例代码02-26

C语言快速排序算法及代码11-01

Java 语言与C 语言代码运行效率的比较01-20

怎么编写高效简洁的C语言代码12-08

10个C语言开源项目代码01-18

C语言兎子产子代码09-18

C语言合并排序及实例代码10-19

C语言奇偶排序算法详解及实例代码11-12