added double jump and sitting state
This commit is contained in:
		
							parent
							
								
									2e5c5a8dde
								
							
						
					
					
						commit
						90d07dde3f
					
				
					 148 changed files with 13050 additions and 0 deletions
				
			
		
							
								
								
									
										18
									
								
								term1/seminar05_iterators/05_move_spaces/main.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								term1/seminar05_iterators/05_move_spaces/main.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| #include <iostream> | ||||
| #include <string> | ||||
| #include <algorithm> | ||||
| 
 | ||||
| using std::cout, std::string, std::endl; | ||||
| 
 | ||||
| void move_spaces(string& s) { | ||||
|         std::stable_sort(s.begin(), s.end(), [](const char& a, const char& b){ return (b == ' '); }); | ||||
| } | ||||
| 
 | ||||
| int main() { | ||||
|         string s; | ||||
|         std::getline(std::cin, s); | ||||
|         move_spaces(s); | ||||
|         // So we can see spaces
 | ||||
|         cout << s << "###" << endl; | ||||
| 
 | ||||
| } | ||||
		Reference in a new issue