Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- #include<conio.h>
- #include<clocale>
- #include<Windows.h>
- struct SOTRUDNIK {
- char fio[21];
- char dol[21];
- int tn;
- int zarplata;
- };
- void Dol(int k, SOTRUDNIK * str);
- void Zap(int k, SOTRUDNIK * str);
- int main()
- {
- int zap;
- setlocale(LC_CTYPE, "Russian");
- int i;
- FILE *f;
- struct SOTRUDNIK str[300];
- if ((f = fopen("сотрудники.txt", "r")) == NULL)
- puts("Файл не найден.");
- for (i = 0; !feof(f); i++) {
- fgets(str[i].fio, 20, f);
- fgets(str[i].dol, 20, f);
- fscanf(f, "%d %d", &str[i].tn, &str[i].zarplata);
- }
- int k = i;
- char c;
- bool proof = true;
- for (int i = 0; i <= k; i++) {
- for (int j = 0; j <= 21; j++) {
- if (str[i].dol[j] == ' ')
- str[i].dol[j] = '