aboutsummaryrefslogtreecommitdiff
path: root/challenge-151
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2022-02-11 19:44:20 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2022-02-11 19:44:20 +0000
commitf4ba287b900a480696349588b5bd2f3626683934 (patch)
treeb6fcb5f7b7c2b42b51688cacd03201987dba4e00 /challenge-151
parentfa25a66ed49c87602a02cd13177f04b5f5ecb2a5 (diff)
downloadperlweeklychallenge-club-f4ba287b900a480696349588b5bd2f3626683934.tar.gz
perlweeklychallenge-club-f4ba287b900a480696349588b5bd2f3626683934.tar.bz2
perlweeklychallenge-club-f4ba287b900a480696349588b5bd2f3626683934.zip
- Added more guest contribution by Ulrich Rieke.
Diffstat (limited to 'challenge-151')
-rw-r--r--challenge-151/ulrich-rieke/cpp/ch-1.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-151/ulrich-rieke/cpp/ch-1.cpp b/challenge-151/ulrich-rieke/cpp/ch-1.cpp
new file mode 100644
index 0000000000..343033519f
--- /dev/null
+++ b/challenge-151/ulrich-rieke/cpp/ch-1.cpp
@@ -0,0 +1,12 @@
+#include <string>
+#include <iostream>
+#include <algorithm>
+
+int main( ) {
+ std::cout << "Please enter a tree, hierarchies separated by |!\n" ;
+ std::string line ;
+ std::getline( std::cin , line ) ;
+ std::cout << std::count( line.begin( ) , line.end( ) , '|' )
+ << std::endl ;
+ return 0 ;
+}