URI Problem (Dividing X by Y) 1116:
Dividing X by Y is a basic problem on URI online judge for novice problem solver.
You can find details on this Link.
import java.util.Scanner;
/**
* @Author : Muhammad Harun-Or-Roshid
* @Date : Oct 18, 2016
* @Time : 11:42:47 PM
*/
public class Uri1116 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
int x = sc.nextInt();
int y = sc.nextInt();
if (y == 0) {
System.out.println("divisao impossivel");
} else {
System.out.printf("%.1f\n", ((double) x / y));
}
}
}
}
0 Comments