added double jump and sitting state
This commit is contained in:
		
							parent
							
								
									2e5c5a8dde
								
							
						
					
					
						commit
						90d07dde3f
					
				
					 148 changed files with 13050 additions and 0 deletions
				
			
		
							
								
								
									
										
											BIN
										
									
								
								term1/seminar03_initialization/02_repeat/a.out~
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								term1/seminar03_initialization/02_repeat/a.out~
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										48
									
								
								term1/seminar03_initialization/02_repeat/main.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								term1/seminar03_initialization/02_repeat/main.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,48 @@ | |||
| #include <iostream> | ||||
| #include <string> | ||||
| #include <string_view> | ||||
| 
 | ||||
| using namespace std; | ||||
| 
 | ||||
| string repeat1(string_view s) | ||||
| { | ||||
|     return string { | ||||
|     s} | ||||
|     +string { | ||||
|     s}; | ||||
| } | ||||
| 
 | ||||
| void repeat2(string & s) | ||||
| { | ||||
|     s += s; | ||||
| } | ||||
| 
 | ||||
| void repeat3(string * s) | ||||
| { | ||||
|     *s += *s; | ||||
| } | ||||
| 
 | ||||
| string *repeat4(string_view s) | ||||
| { | ||||
|     string *result = new string; | ||||
|     *result = string { | ||||
|     s} +string { | ||||
|     s}; | ||||
|     return result; | ||||
| } | ||||
| 
 | ||||
| int main() | ||||
| { | ||||
|     string meow; | ||||
|     cin >> meow; | ||||
| 
 | ||||
|     cout << "test of repeat1:" << endl << repeat1(meow) << endl; | ||||
| 
 | ||||
|     repeat2(meow); | ||||
|     cout << "test of repeat2:" << endl << meow << endl; | ||||
| 
 | ||||
|     repeat3(&meow); | ||||
|     cout << "test of repeat3:" << endl << meow << endl; | ||||
| 
 | ||||
|     cout << "test of repeat4:" << endl << *repeat4(meow) << endl; | ||||
| } | ||||
							
								
								
									
										38
									
								
								term1/seminar03_initialization/02_repeat/main.cpp~
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								term1/seminar03_initialization/02_repeat/main.cpp~
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | |||
| #include <iostream> | ||||
| #include <string> | ||||
| #include <string_view> | ||||
| 
 | ||||
| using namespace std; | ||||
| 
 | ||||
| string repeat1(string_view s) { | ||||
|     return string{s} + string{s}; | ||||
| } | ||||
| 
 | ||||
| void repeat2(string& s) { | ||||
|     s += s; | ||||
| } | ||||
| 
 | ||||
| void repeat3(string* s) { | ||||
|     *s += *s; | ||||
| } | ||||
| 
 | ||||
| string* repeat4(string_view s) { | ||||
|     string* result = new string; | ||||
|     *result = string{s} + string{s}; | ||||
|     return result; | ||||
| } | ||||
| 
 | ||||
| int main() { | ||||
|         string meow; | ||||
|         cin >> meow; | ||||
| 
 | ||||
|         cout << "test of repeat1:" << endl << repeat1(meow) << endl; | ||||
|          | ||||
|         repeat2(meow); | ||||
|         cout << "test of repeat2:" << endl << meow << endl;        | ||||
| 
 | ||||
|         repeat3(&meow); | ||||
|         cout << "test of repeat3:" << endl << meow << endl;        | ||||
|          | ||||
|         cout << "test of repeat4:" << endl << *repeat4(meow) << endl;        | ||||
| } | ||||
		Reference in a new issue