Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- void writeToFile() {
- FILE *f = fopen("text.txt", "w");
- char c;
- while((c = getchar()) != '#') {
- fputc(c, f);
- }
- fclose(f);
- }
- int main() {
- // writeToFile();
- FILE *vlez = fopen("text.txt", "r");
- char niza[1001];
- int i = 0;
- char c;
- while(fscanf(vlez, "%c", &c)) {
- if(c == '#') {
- break;
- }
- c = tolower(c);
- niza[i] = c;
- i++;
- }
- int kolku_parovi = 0;
- for(int j = 0; j < strlen(niza); j++) {
- if((niza[j] == 'a' || niza[j] == 'e' || niza[j] == 'i' || niza[j] == 'o' || niza[j] == 'u') && (niza[j + 1] == 'a' || niza[j + 1] == 'e' || niza[j + 1] == 'i' || niza[j + 1] == 'o' || niza[j + 1] == 'u')) {
- printf("%c%c\n", niza[j], niza[j + 1]);
- kolku_parovi++;
- }
- }
- printf("%d\n", kolku_parovi);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement