#include #include #include #include #include #include #include using namespace std; const int n=100; bool z; char a[n], c, a2[n]; int j, timer=1000; time_t t; char file[10]; FILE *f, *fc, *fb; struct tim { struct tm st; int klk,pom; float sec, prc; }dani; struct mm{ char m[n]; }; mm r[10]; enum ConsoleColor { Black = 0, Blue = 1, Green = 2, Cyan = 3, Red = 4, Magenta = 5, Brown = 6, LightGray = 7, DarkGray = 8, LightBlue = 9, LightGreen = 10, LightCyan = 11, LightRed = 12, LightMagenta = 13, Yellow = 14, White = 15 }; void SetColor(ConsoleColor text, ConsoleColor background); void menu(); void trenager(); void result(); void pro(); void help(); void stat(); void add(); void pass(); void info(); void clean_base(); void main() { setlocale(0, ""); SetColor(Black, White); menu(); getch(); } void menu(){ system("mode con cols=80 lines=25"); system("cls"); int i, k=6; z=0; strcpy(r[0].m, "РОЗПОЧАТИ"); strcpy(r[1].m, "РЕЗУЛЬТАТИ"); strcpy(r[4].m, "ПРО ПРОГРАМУ"); strcpy(r[3].m, "ДОПОМОГА"); strcpy(r[5].m, "ВИХiД"); strcpy(r[2].m, "КЕРУВАННЯ"); strcpy(r[6].m, " "); while(1){ cout<<"\t\tЗробiть ваш вибiр:\n"; for(i=0; i<=k;i++){ if(i==j) SetColor(White, Black); if(i==j+1) SetColor(Black, White); cout<<"\t"<(getch()); if(c==72 && j>0) j--; else if(c==80 && j(getch()); switch(c){ case 13: clean_base(); break; case 27: menu(); break; default:{system("cls");} } } } void pro(){ system("cls"); cout<<"Пpoграму створив Строгуш назарiй\nГалицький коледж 2012 рiк\n Версiя 1.0\n"; cout<(getch()); switch(c){ case 13: pass(); break; case 27: menu(); break; } } else {fc=fopen("baza.dat","r+b"); srand(time(NULL)); fb = fopen("baza.dat", "r+b"); while(!feof(fb)){ fread(&a2, sizeof(a2), 1, fb); kilk++; } kilk--; fclose(fb); if(!kilk) {cout<(getch()); switch(c){ case 13: pass(); break; case 27: menu(); break; } } else{ float a1; char aa[100]; rech[0]='\0'; int r=10; for(int j=0;j(c)!=27) {pom++;cout<<"\a";} else menu(); system("cls"); } a1=(GetTickCount()-a1)/1000; int rozm=strlen(rech); f = fopen("ex.dat", "a+b"); dani.prc=pom/rozm*100; dani.klk = rozm; dani.sec = a1; dani.pom = pom; time(&t); dani.st = *localtime(&t); fwrite(&dani, sizeof(dani), 1, f); const int k=2; fclose(f); pom=0; stat(); cout<(getch()); switch(c){ case 13: trenager(); break; case 27: menu(); break; } } } } void stat(){ SetColor(White, Black); cout<(c)!=13 && static_cast(c)!=27){ pass_user[l++] = c; cout<(c)==27) menu(); else if(static_cast(c)==13) {pass_user[l++]='\0'; if(!strcmp(pass_user,a)) {SetColor(Green, White); cout<(getch()); if(c==72 && j>0) j--; else if(c==80 && j>a; fc = fopen("baza.dat","a+b"); fwrite(&a,sizeof(a),1,fc); fclose(fc); SetColor(Green, White);cout<<"Данi записанi!"; SetColor(Black, White); Sleep(timer); system("cls"); cout<<"Записати ще?"; cout<(getch()); switch(c){ case 13: add(); break; case 27: menu(); break; default:{system("cls");} } } } void info(){ cout<