Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int checkLetters(char oneStr[101])
- {
- int z = 0;
- for (int i = 0; i <= strlen(oneStr); i++)
- {
- switch (oneStr[i])
- {
- case 'a':
- case 'e':
- case 'y':
- case 'o':
- case 'u':
- z++;
- break;
- }
- }
- return z;
- }
- int main()
- {
- setlocale(0, "");
- char oneStrTest1[] = "abc quq 123"; // 2
- char oneStrTest2[] = "aouye"; // 5
- char oneStrTest3[] = ""; // 0
- char oneStrTest4[] = "bbr fgh"; // 0
- if ((checkLetters(oneStrTest1) == 2 && checkLetters(oneStrTest2) == 5)
- && checkLetters(oneStrTest3) == 0 && checkLetters(oneStrTest4) == 0)
- cout << "Программа работает правильно...\n";
- else
- cout << "Программа работает не правильно...\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement