summaryrefslogtreecommitdiff
path: root/5p12.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-08-29 15:56:24 +0200
committerOskar <[email protected]>2024-08-29 15:56:24 +0200
commit5cff617b2aa2148773256eed1a00607e0189529b (patch)
tree7c291f07e5363806c3cebcec1c91237cb6f8bd53 /5p12.cpp
parent9094c8aa159ee2386fa1d2ff19cbdc73f321303b (diff)
5.12 was a pain to figure out, its not very pretty i will admit
Diffstat (limited to '5p12.cpp')
-rw-r--r--5p12.cpp84
1 files changed, 84 insertions, 0 deletions
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;
+}