aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ;
+}