| endosymbiosis |
ῡ ѰŶ ѹ Ȯغ.
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <windows.h>
char* chk_pw()
{
FILE* fp;
char real_pw[20];
char* p_real=NULL;
int check=0;
fp=fopen("password.txt", "r");
fscanf(fp, "%s", real_pw);
p_real = real_pw;
return p_real;
}
int main(int argc, char* argv[])
{
FILE* fp;
char input_pw[20], new_pw[20];
int type;
while(1)
{
system("cls");
printf("йȣ Էϼ : ");
scanf("%s", input_pw);
fflush(stdin);
if(strcmp(chk_pw(), input_pw)==0)
{
system("cls");
printf("1. йȣ ϱ.\n");
printf("2. α ϱ.\n");
printf(" Ͻðڽϱ? ");
scanf("%d", &type);
switch(type)
{
case 1:
fp=fopen("password.txt", "w+");
printf("ο йȣ Էϼ : ");
scanf("%s", new_pw);
fprintf(fp, "%s", new_pw);
printf("Press any key to come back...\n");
getch();
fclose(fp);
break;
case 2:
printf("α մϴ.\n");
return 0;
break;
default:
printf("߸ Է°Դϴ.\n");
printf("Press any key to come back...\n");
getch();
break;
};
}
else
{
printf("йȣ ߸ Էϼ̽ϴ.\n");
printf("Press any key to come back...\n");
getch();
}
};
return 0;
} |
2011/07/16 |
|