Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- bool voc(char c)
- {
- if(c == 'a' or c == 'e' or c == 'i' or c == 'o' or c == 'u')
- return 1;
- return 0;
- }
- int main()
- {
- FILE *in;
- in = fopen("pb3.txt", "rt");
- if (in == NULL)
- {
- perror("NU");
- return -1;
- }
- char s[101] = {};
- char rez[101][101] = {};
- int k = 0;
- while(fgets(s, 101, in))
- {
- strcpy(rez[k++], s);
- }
- fclose(in);
- FILE *out;
- out = fopen("pb3out.txt", "w+");
- if (out == NULL)
- {
- perror("NU");
- return -1;
- }
- for(int i=k-1; i>=0; i--)
- {
- fprintf(out, "%s", rez[i]);
- //fprintf(out, "\n");
- }
- fclose(out);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement