summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--5p10.cpp42
-rw-r--r--5p11.cpp54
-rw-r--r--5p12.cpp84
-rw-r--r--5p13.cpp12
-rw-r--r--5p9.cpp42
5 files changed, 234 insertions, 0 deletions
diff --git a/5p10.cpp b/5p10.cpp
new file mode 100644
index 0000000..27c8a71
--- /dev/null
+++ b/5p10.cpp
@@ -0,0 +1,42 @@
+#include <iostream>
+
+/*
+ *
+ * 5.10
+ *
+ * Same as 5.9 because i already considered capital letters
+ */
+
+int main () {
+
+ char Character = 0;
+ int Va = 0;
+ int Ve = 0;
+ int Vi = 0;
+ int Vo = 0;
+ int Vu = 0;
+ int NonVowel = 0;
+ while(std::cin >> Character) {
+ if(Character == 'a' || Character == 'A') {
+ ++Va;
+ } else if (Character == 'e' || Character == 'E') {
+ ++Ve;
+ } else if (Character == 'i' || Character == 'I') {
+ ++Vi;
+ } else if (Character == 'o' || Character == 'O') {
+ ++Vo;
+ } else if (Character == 'u' || Character == 'U') {
+ ++Vu;
+ } else {
+ ++NonVowel;
+ }
+ }
+
+ std::cout << "A: " << Va << "\n"
+ << "E: " << Ve << "\n"
+ << "I: " << Vi << "\n"
+ << "O: " << Vo << "\n"
+ << "U: " << Vu << "\n"
+ << "Non Vowel: " << NonVowel << std::endl;
+ return 0;
+}
diff --git a/5p11.cpp b/5p11.cpp
new file mode 100644
index 0000000..460e0e8
--- /dev/null
+++ b/5p11.cpp
@@ -0,0 +1,54 @@
+#include <iostream>
+
+/*
+ *
+ * 5.11
+ *
+ *
+ */
+
+int main () {
+
+ char Character = 0;
+ uint32_t Va = 0;
+ uint32_t Ve = 0;
+ uint32_t Vi = 0;
+ uint32_t Vo = 0;
+ uint32_t Vu = 0;
+ uint32_t BlankSpace = 0;
+ uint32_t Tabs = 0;
+ uint32_t Newlines = 0;
+ uint32_t Other = 0;
+ while(std::cin.get(Character)) {
+ if(Character == 'a' || Character == 'A') {
+ ++Va;
+ } else if (Character == 'e' || Character == 'E') {
+ ++Ve;
+ } else if (Character == 'i' || Character == 'I') {
+ ++Vi;
+ } else if (Character == 'o' || Character == 'O') {
+ ++Vo;
+ } else if (Character == 'u' || Character == 'U') {
+ ++Vu;
+ } else if (Character == '\n') {
+ ++Newlines;
+ } else if (Character == '\t') {
+ ++Tabs;
+ } else if (Character == ' ') {
+ ++BlankSpace;
+ } else {
+ ++Other;
+ }
+ }
+
+ std::cout << "A: " << Va << "\n"
+ << "E: " << Ve << "\n"
+ << "I: " << Vi << "\n"
+ << "O: " << Vo << "\n"
+ << "U: " << Vu << "\n"
+ << "Tabs: " << Tabs << "\n"
+ << "Newlines: " << Newlines << "\n"
+ << "Blank Space: " << BlankSpace << "\n"
+ << "Others: " << Other << std::endl;
+ return 0;
+}
diff --git a/5p12.cpp b/5p12.cpp
new file mode 100644
index 0000000..c9c6117
--- /dev/null
+++ b/5p12.cpp
@@ -0,0 +1,84 @@
+#include <iostream>
+
+/*
+ *
+ * 5.12
+ *
+ *
+ */
+
+int main () {
+
+ char Character = 0;
+ uint32_t Va = 0;
+ uint32_t Ve = 0;
+ uint32_t Vi = 0;
+ uint32_t Vo = 0;
+ uint32_t Vu = 0;
+ uint32_t BlankSpace = 0;
+ uint32_t Tabs = 0;
+ uint32_t Newlines = 0;
+ uint32_t Other = 0;
+ uint32_t ffflfi = 0;
+ bool factive = false;
+ while(std::cin.get(Character)) {
+ if(Character == 'a' || Character == 'A') {
+ ++Va;
+ factive = false;
+ } else if (Character == 'e' || Character == 'E') {
+ ++Ve;
+ factive = false;
+ } else if (Character == 'i' || Character == 'I') {
+ if(factive) {
+ ++ffflfi;
+ factive = false;
+ }
+
+ ++Vi;
+ } else if (Character == 'o' || Character == 'O') {
+ ++Vo;
+ factive = false;
+ } else if (Character == 'u' || Character == 'U') {
+ ++Vu;
+ factive = false;
+ } else if (Character == 'f') {
+ if(factive) {
+ ++ffflfi;
+ factive = false;
+ continue;
+ }
+
+ factive = true;
+ } else if (Character == 'l') {
+ if(factive) {
+ ++ffflfi;
+ factive = false;
+ }
+
+ } else if (Character == '\n') {
+ ++Newlines;
+ factive = false;
+ } else if (Character == '\t') {
+ ++Tabs;
+ factive = false;
+ } else if (Character == ' ') {
+ ++BlankSpace;
+ factive = false;
+ } else {
+ ++Other;
+ factive = false;
+ }
+ }
+
+ std::cout << "A: " << Va << "\n"
+ << "E: " << Ve << "\n"
+ << "I: " << Vi << "\n"
+ << "O: " << Vo << "\n"
+ << "U: " << Vu << "\n"
+ << "Tabs: " << Tabs << "\n"
+ << "Newlines: " << Newlines << "\n"
+ << "Blank Space: " << BlankSpace << "\n"
+ << "ffflfi: " << ffflfi << "\n"
+ << "Others: " << Other << std::endl;
+ return 0;
+}
diff --git a/5p13.cpp b/5p13.cpp
new file mode 100644
index 0000000..58d5fbf
--- /dev/null
+++ b/5p13.cpp
@@ -0,0 +1,12 @@
+#include <iostream>
+
+/*
+ *
+ * Description
+ *
+ *
+ */
+
+int main () {
+ return 0;
+}
diff --git a/5p9.cpp b/5p9.cpp
new file mode 100644
index 0000000..ea3f054
--- /dev/null
+++ b/5p9.cpp
@@ -0,0 +1,42 @@
+#include <iostream>
+
+/*
+ *
+ * 5.9
+ *
+ *
+ */
+
+int main () {
+
+ char Character = 0;
+ int Va = 0;
+ int Ve = 0;
+ int Vi = 0;
+ int Vo = 0;
+ int Vu = 0;
+ int NonVowel = 0;
+ while(std::cin >> Character) {
+ if(Character == 'a' || Character == 'A') {
+ ++Va;
+ } else if (Character == 'e' || Character == 'E') {
+ ++Ve;
+ } else if (Character == 'i' || Character == 'I') {
+ ++Vi;
+ } else if (Character == 'o' || Character == 'O') {
+ ++Vo;
+ } else if (Character == 'u' || Character == 'U') {
+ ++Vu;
+ } else {
+ ++NonVowel;
+ }
+ }
+
+ std::cout << "A: " << Va << "\n"
+ << "E: " << Ve << "\n"
+ << "I: " << Vi << "\n"
+ << "O: " << Vo << "\n"
+ << "U: " << Vu << "\n"
+ << "Non Vowel: " << NonVowel << std::endl;
+ return 0;
+}