The_Law

Untitled

Dec 28th, 2017
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. int cnt(void)
  2. {
  3.    FILE* in = fopen("input.txt", "r");
  4.    int res = 0;
  5.    int tmp = 0;
  6.  
  7.    while (!feof(in))
  8.    {
  9.         char c;
  10.        
  11.         fscanf( in, "%c", &c);
  12.         if (c == ' '){
  13.             if (res ==101)
  14.                   ++res;
  15.         tmp = 0;}
  16.         else if ('0' <= c && c <= '9')
  17.                tmp = tmp *10 + c - '0';
  18.         else FIGACH OSHIBKU
  19.     }
  20.     if (tmp == 101)
  21.         ++res;
  22.    
  23.    printf("%d", res);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment