Guest User

Untitled

a guest
Jan 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void)
  5. {
  6. FILE *fp;
  7. char c;
  8. int n = 0;
  9. int el1=1;
  10. int el2=1;
  11. fp = fopen("notes", "r");
  12. if(fp == 0)
  13. {
  14. printf("не могу открыть файл notes");
  15. return 0;
  16. }
  17. while((c = getchar() || el2 || el1 )!= EOF)
  18. {
  19. fscanf(fp, "%d",&el1);
  20. fscanf(fp, "%d",&el2);
  21. printf("%d, %d", el1, el2);
  22. if (el2 > el1) {
  23. ++n;
  24. }
  25. else {
  26. n = 0;
  27. }
  28. }
  29. printf("%d", n);
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment