回覆列表
  • 1 # 會更明白啊

    //用getch()函式,這個函式只接收字元,不回顯,接收到一個字元,可以直接輸出‘*’#include<stdio.h>#include<conio.h>#include <stdlib.h>#define PassWordLength 10int main(){ char PassWord[PassWordLength+1]={0}; char name[10]; int i=0; printf("Enter your name:"); scanf("%s",name); printf("Please enter the password:"); for(i = 0; i < PassWordLength; i++) { PassWord[i] = getch(); if(PassWord[i]!=0x0d)//輸入的不是回車符,輸出"*" printf("*"); else break; } PassWord[PassWordLength]=0; printf("\nName:%s",name); printf("\nPassword: %s\n",PassWord); system("PAUSE"); return 0;}

  • 中秋節和大豐收的關聯?
  • 19賽季乒超聯賽男團第9輪比賽結束,具體戰況如何。哪支球隊表現最佳,你怎麼看?