スレを勃てるまでもないC/C++の質問はここで 8 at TECH
[2ch|▼Menu]
253:デフォルトの名無しさん
09/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);
 }
}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5380日前に更新/124 KB
担当:undef