summaryrefslogtreecommitdiff
path: root/CPP/cpp_book/chap6/find_url/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/cpp_book/chap6/find_url/main.cpp')
-rw-r--r--CPP/cpp_book/chap6/find_url/main.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/CPP/cpp_book/chap6/find_url/main.cpp b/CPP/cpp_book/chap6/find_url/main.cpp
new file mode 100644
index 0000000..8bd9416
--- /dev/null
+++ b/CPP/cpp_book/chap6/find_url/main.cpp
@@ -0,0 +1,26 @@
+#include <iostream>
+#include <vector>
+#include <algorithm>
+
+std::vector<std::string> find_urls(const std::string& s);
+
+int
+main(void)
+{
+ std::string s;
+
+ while(std::getline(std::cin, s)) {
+ std::vector<std::string> urls;
+ urls = find_urls(s);
+
+ std::vector<std::string>::const_iterator i = urls.begin();
+
+ while (i != urls.end()) {
+ std::cout << *i << std::endl;
+ i++;
+ }
+ }
+
+ return 0;
+}
+