- 253 名前:デフォルトの名無しさん mailto:sage [2009/03/09(月) 12:31:54 ]
- >>249 メモ帳べた書きでコンパイルしてない。好きにしろ。
#include <stdio.h> #include <conio.h> int main(){ const char* password = "1994"; int count = 0; do{ int i; char input_password[4]; printf("パスワードを入力して下さい。(4文字): \n>"); for(i = 0; i < 4; ++i){input_password[i] = getch(); putchar('*');} }while(!strcmp(password, input_password) && count++ < 3); if(count >= 3){ puts("仏の顔も三度まで!\n正式なpasswordがないとシステムは使用できません!"); }else{ printf("password = %s\nシステムの使用を許可します。\n", password); } }
|

|