cours 2 algo
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								q2/cours2/Couple.class
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								q2/cours2/Couple.class
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										27
									
								
								q2/cours2/Couple.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								q2/cours2/Couple.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | ||||
| public class Couple { | ||||
|  | ||||
| 	private int q; | ||||
| 	private int r; | ||||
|  | ||||
| 	public Couple(int q, int r) { | ||||
| 		this.q = q; | ||||
| 		this.r = r; | ||||
| 	} | ||||
|  | ||||
| 	public void setQ(int q) { | ||||
| 		this.q = q; | ||||
| 	} | ||||
|  | ||||
| 	public int getQ() { | ||||
| 		return q; | ||||
| 	} | ||||
|  | ||||
| 	public void setR(int r) { | ||||
| 		this.r = r; | ||||
| 	} | ||||
|  | ||||
| 	public int getR() { | ||||
| 		return r; | ||||
| 	} | ||||
|  | ||||
| } | ||||
							
								
								
									
										
											BIN
										
									
								
								q2/cours2/Division.class
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								q2/cours2/Division.class
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										11
									
								
								q2/cours2/Division.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								q2/cours2/Division.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| public class Division { | ||||
| 	public static void main(String[] args) { | ||||
| 		Couple test = Division(5, 3); | ||||
| 		System.out.println(test.getQ() + ": " + test.getR()); | ||||
|  | ||||
| 	} | ||||
| 	public static Couple Division(int a, int b){ | ||||
| 		return new Couple(a/b, a%b); | ||||
| 		 | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user