mirror of https://github.com/sunface/rust-course
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					15 lines
				
				312 B
			
		
		
			
		
	
	
					15 lines
				
				312 B
			| 
								 
											4 years ago
										 
									 | 
							
								// functions5.rs
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								// 让我能够编译!执行 `rustex hint functions5` 获取提示 :)
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								
							 | 
						||
| 
								 | 
							
								// I AM NOT DONE
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								/// 翻译: [mg-chao](https://github.com/mg-chao)
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								fn main() {
							 | 
						||
| 
								 | 
							
								    let answer = square(3);
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								    println!("The answer is {}", answer);// 译:"答案是 {}"
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								fn square(num: i32) -> i32 {
							 | 
						||
| 
								 | 
							
								    num * num;
							 | 
						||
| 
								 | 
							
								}
							 |