Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<math.h>
- int main() {
- FILE *fp1, *fp2;
- char c;
- fp1=fopen("ULAZ.txt", "r");
- if (fp1 == 0) printf ("Datoteka za citanje nije uspjesno otvorena! ");
- else {
- fp2=fopen("BROJEVI.txt", "w");
- if (fp2 == 0) printf ("Datoteka za pisanje nije uspjesno otvorena! ");
- else
- while (!feof(fp1)) {
- c = fgetc(fp1);
- if (c >= 0x30 && c <= 0x39) {
- fprintf(fp2, "%c", c);
- c = fgetc(fp1);
- while (c >= 0x30 && c <= 0x39) {
- fprintf(fp2, "%c", c);
- c = fgetc(fp1);
- }
- fprintf(fp2, "\n");
- }
- }
- }
- fclose(fp1);
- fclose(fp2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement