Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main (void) {
  4. FILE *input;
  5. int x, y, key = 0;
  6. input = fopen ("in.txt", "r");
  7. key = fscanf (input, "%d", &x);
  8. if (key == -1) {
  9. printf ("В файле нет чисел\n");
  10. }
  11. printf ("%d ", x);
  12. while (fscanf (input, "%d", &y) == 1) {
  13. if (x < y) {
  14. printf ("%d ", y);
  15. } else {
  16. printf ("\n");
  17. printf ("%d ", y);
  18. }
  19. x = y;
  20. }
  21. fclose (input);
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement