#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
int Password();
void main()
{int k;
if (Password() == 1)
{
printf("You entered correct password!\n");
}
else
{
printf("False!");
}
getch();
}
int Password()
{
const n=10;
char s[n], p[n];
FILE *pass;
pass = fopen("password.txt","D:\TC\BIN\password.txt");
fgets(s,n,pass);
printf("Enter password:\n",n);
gets(p);
fclose(pass);
if (strcmp(s,p) == 0)
return(1);
else
return 0;
}
простенькая прога на запрос пароля, язык C, компилятор Turbo C++ |