FranciscoSoccol

Lista 10 - Exercicio 01

Sep 2nd, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. // o exercicio ler um arquivo.tx e conta quantos saltos de linhas o arquivo possui, ler via comando prompt
  4.  
  5. int main()
  6. {
  7.     int c, n = 1;
  8.     while((c=getchar())!=EOF)
  9.         if(c == '\n')
  10.             n++;
  11.     printf("%d", n-1);
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment