C語言精簡代碼
知道C語言精簡代碼是怎么樣的嗎?下面小編為大家整理了C語言精簡代碼,希望能幫到大家!
模擬銀行輸入密碼的源碼
#include
#include
int main()
{
int pass,i=0,p=5;
/pic/p>
printf("請注意周邊環(huán)境,再輸入密碼: ");
while(pass!=123456)/pic/p>
{
scanf("%d",&pass);/pic/p>
if(pass!=123456)
printf("輸入密碼錯誤%d次... ",++i);
if(i>=3)/pic/p>
{
printf("對不起,你的卡被取款機(jī)吃了,請聯(lián)系銀行... ");
while(i==3&&p>=0)/pic/p>
{
printf(" %d秒退出系統(tǒng)...",p--);
Sleep(1000);
}
return -1;
}
}
if(pass==123456)/pic/p>
{
printf("密碼正確,進(jìn)入系統(tǒng)中... ");
while(p>=0)
{
printf(" %d秒進(jìn)入系統(tǒng)...",p--);
Sleep(1000);/覺一秒鐘1秒=1000毫秒
}
}
return 0;
}
【C語言精簡代碼】相關(guān)文章:
C語言的預(yù)處理代碼03-15
C語言快速排序?qū)嵗a02-26
C語言快速排序算法及代碼11-01
怎么編寫高效簡潔的C語言代碼12-08
10個C語言開源項目代碼01-18
C語言兎子產(chǎn)子代碼09-18
C語言合并排序及實例代碼10-19
C語言奇偶排序算法詳解及實例代碼11-12