Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 12 / tesk2.cpp
diff options
context:
space:
mode:
Commit55fc7eb3bba83f4084b2f897c61d0280a5f9c097 (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2021-10-02 17:44:35 +0300
Committer
 angeld55 <angel_dimitriev@abv.bg>
2021-10-02 17:44:35 +0300
Files85d32a9a73f85c54162f9233f36a054ebe0de212 /Sem. 12/tesk2.cpp
Introduction_to_programming_FMI-55fc7eb3bba83f4084b2f897c61d0280a5f9c097.tar
Introduction_to_programming_FMI-55fc7eb3bba83f4084b2f897c61d0280a5f9c097.tar.gz
Introduction_to_programming_FMI-55fc7eb3bba83f4084b2f897c61d0280a5f9c097.zip
Parent7f51b56297270d4a1f808bc73d082b71418a2fe0 (diff)
new
1 files changed, 0 insertions, 56 deletions
-rw-r--r--Sem. 12/tesk2.cpp56
diff --git a/Sem. 12/tesk2.cpp b/Sem. 12/tesk2.cpp
deleted file mode 100644
index e41c069..0000000
--- a/Sem. 12/tesk2.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <iostream>
-using namespace std;
-
-bool isSymbol(char ch)
-{
- return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z');
-}
-bool isVowel(char ch)
-{
- switch (ch)
- {
- case 'A':
- case 'O':
- case 'I':
- case 'U':
- case 'E':
- case 'a':
- case 'o':
- case 'i':
- case 'u':
- case 'e':return true;
- }
- return false;
-}
-void countVowelAndCons(const char* str, int& vowelCount, int& consCount)
-{
- while (*str != '\0')
- {
- if (isSymbol(*str))
- {
- if (isVowel(*str))
- vowelCount++;
- else
- consCount++;
- }
- str++;
- }
-}
-
-bool isBalanced(const char* str)
-{
- int vowelCount = 0, consCount = 0;
-
- countVowelAndCons(str, vowelCount, consCount);
-
- return vowelCount == consCount;
-}
-
-int main()
-{
- const char* str = "TestMeau";
-
- cout << isBalanced(str) << endl;
-
-
-}