Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. FILE *fa,*fr;
  5. int c, cnt;
  6. cnt = 0;
  7.  
  8. fr= fopen ("vstup.txt", "r");
  9. fa= fopen ("cisla.txt", "a");
  10.  
  11. while ((c = getc(fr)) !=EOF){
  12.  
  13. if (c >= 'a' && c <= 'z'){
  14. cnt++;
  15. }
  16. putc (c, fa);
  17.  
  18. if (c == '\n'){
  19. fprintf (fa, "%d\n", cnt);
  20. cnt = 0;
  21. }
  22.  
  23. }
  24.  
  25. fclose(fr);
  26. fclose(fa);
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement