Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <conio.h>
- int main()
- {
- while (true)
- {
- char slowo[30];
- int a = 0, e = 0, x = 0, o = 0, u = 0, y = 0;
- printf("Wprowadz dowlony tekst. q lub Q - konczy wprowadzanie znakow.\n");
- scanf("%s", &slowo);
- if (slowo[0] == 'Q' || slowo[0] == 'q')
- break;
- for (int i = 0; i < sizeof(slowo); i++)
- {
- if (slowo[i] == 'a' || slowo[i] == 'A')
- a++;
- if (slowo[i] == 'e' || slowo[i] == 'E')
- e++;
- if (slowo[i] == 'i' || slowo[i] == 'I')
- x++;
- if (slowo[i] == 'o' || slowo[i] == 'O')
- o++;
- if (slowo[i] == 'u' || slowo[i] == 'U')
- u++;
- if (slowo[i] == 'y' || slowo[i] == 'Y')
- y++;
- }
- printf("Liczba samoglosek\n");
- printf("a = %d\n", a);
- printf("e = %d\n", e);
- printf("i = %d\n", x);
- printf("o = %d\n", o);
- printf("u = %d\n", u);
- printf("y = %d\n", y);
- printf("---------------------------------------------------------------------------\n\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement