repl.it
@bikey/

sdf

Java

No description

fork
loading
Files
  • Main.java
  • jdt.ls-java-project
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//クラス名は必ずMainにする必要があります。
import java.util.*;

public class Main {
  public static void main(String args[] ) throws Exception {
		Scanner sc = new Scanner(System.in);
    int a,b;
    a= b= 0;
		try{
			 a = sc.nextInt();
			 b = sc.nextInt();
		}catch(Exception e){
			System.out.println("Error");
      return;
		}
    int res1 = a % b;
		int res2 = a / b;
    if (a < 0 || b <= 0){
				System.out.println("Error");
				
			}else if(res1 == 0){
				System.out.println(res2);

			}else{
				System.out.println(res2 + "..." + res1);
			}
		
		
 }
}
?