aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main1.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/main1.cpp b/main1.cpp
index 3af30cf..8534745 100644
--- a/main1.cpp
+++ b/main1.cpp
@@ -1,5 +1,23 @@
#include <iostream>
+#include <vector>
+#include <string>
+
+template <class T>
+T h (T i){
+ return i;
+}
int main(){
- return 1;
+ std::string v;
+ bool keep = true;
+ std::cout << "Welcome to template experiment\n";
+ std::cout << "Stop the program by writting quit anywhere in the text\n";
+ while (keep){
+ std::cout << "Write something :";
+ std::cin >> v;
+ std::cout << "You wrote: " << h(v) << "\n";
+ if (v=="quit")
+ keep = false;
+ }
+ return 0;
}