Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define MAX 100
- //ne menuvaj!
- void wtf() {
- FILE *f = fopen("sp.txt", "w");
- char c;
- while((c = getchar()) != EOF) {
- fputc(c, f);
- }
- fclose(f);
- }
- void rff() {
- FILE *f = fopen("output.txt", "r");
- char c;
- while((c = fgetc(f)) != EOF) {
- putchar(c);
- }
- fclose(f);
- }
- int e_samoglaska(char c) {
- if(c == 'A' || c == 'a' || c == 'E' || c == 'e' || c == 'I' || c == 'i' || c == 'O' || c == 'o' || c == 'U' || c == 'u') {
- return 1;
- }
- return 0;
- }
- int main() {
- wtf();
- FILE *f = fopen("sp.txt", "r");
- FILE *out = fopen("output.txt", "w");
- if(f != NULL) { // toa znaci deka datotekata postoi
- int k;
- fscanf(f, "%d", &k);
- char c;
- c = fgetc(f); // getchar()
- while((c = fgetc(f)) != EOF) { // EOF - end of file
- if(e_samoglaska(c) == 1) {
- int brojac = k;
- while(brojac > 0) {
- fprintf(out, "%c", c);
- brojac -= 1;
- }
- }
- else {
- fprintf(out, "%c", c);
- }
- }
- }
- rff();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement