include stdio include stdlib include locale int main void int FILE set

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main(void){
int a, n=0;
FILE *p;
setlocale(LC_CTYPE,"Russian");
if((p=fopen("test.txt","r"))==NULL){
puts("Не удалось открыть файл");
system("PAUSE");
return 1;
}
while(!feof(p)){
n++;
if(fscanf(p,"%d", &a)==0){
puts("Неизвестный формат");
system("PAUSE");
return 2;
}
if(n==3){
printf("%d \n", a);
}
}
fclose(p);
system("PAUSE");
return 0;
}