summaryrefslogtreecommitdiff
path: root/4p23.cpp
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-08-20 13:51:53 +0200
committerOskar <[email protected]>2024-08-20 13:51:53 +0200
commit12dda8d5244e86096a5ea56014073dd1892cc409 (patch)
treeffaf835edd33da23a58405db5e733ebfc71e5a5e /4p23.cpp
parentd0c6ac2b68380020d76d7f938307e056a25eb5f5 (diff)
more
Diffstat (limited to '4p23.cpp')
-rw-r--r--4p23.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/4p23.cpp b/4p23.cpp
new file mode 100644
index 0000000..b53cc84
--- /dev/null
+++ b/4p23.cpp
@@ -0,0 +1,26 @@
+#include <iostream>
+
+/*
+ *
+ * 4.23
+ *
+ *
+ */
+
+int main () {
+
+ /*
+
+ Took me a while to figure out
+ was not so sure what the author
+ wanted to achieve. I mean there
+ are several ways we can paranthesize
+ this so it was a little hard to do...
+
+ */
+
+ std::string s = "word";
+ std::string pl = s + (s[s.size() - 1] == 's' ? "" : "s") ;
+ std::cout << pl << std::endl;
+ return 0;
+}