Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <string>
- #include <map>
- #include <algorithm>
- using namespace std;
- typedef long long ll;
- int main()
- {
- string s = "black red green yellow";
- string tmp = "";
- for(int i = 0; i < s.size(); i++) {
- if(s[i] == ' ') {
- cout << tmp << endl;
- tmp = "";
- }
- else {
- tmp += s[i];
- }
- }
- cout << tmp << endl;
- return 0;
- }
- // 2222222222
- // 22222222222
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement