Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- int i = 0;
- int nr[32];
- FILE *plik = fopen("numery.txt", "r"); // otworzenie pliku do odczytu
- if (!plik)
- {
- puts("Brak pliku numery.txt");
- return EXIT_FAILURE;
- }
- while (1)
- {
- fscanf(plik, "%d\n", &nr[i]);
- if (feof(plik) != 0)
- break;
- printf("%d %d\n", i + 1, nr[i]);
- ++i;
- }
- fclose(plik);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment