Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (void) {
- FILE *input;
- int x, y, key = 0;
- input = fopen ("in.txt", "r");
- key = fscanf (input, "%d", &x);
- if (key == -1) {
- printf ("В файле нет чисел\n");
- }
- printf ("%d ", x);
- while (fscanf (input, "%d", &y) == 1) {
- if (x < y) {
- printf ("%d ", y);
- } else {
- printf ("\n");
- printf ("%d ", y);
- }
- x = y;
- }
- fclose (input);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement