Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ca_2;
- import java.util.Scanner;
- public class CA_2
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int size = s.nextInt();
- for (int i = 0; i < size; i++)
- {
- System.out.print(lampaDel(s.nextInt(),s.nextInt())+" ");
- }
- }
- public static int lampaDel(double a,double b)
- {
- int c = (int)((a/b)+0.5);
- if (c<0) return c-1;
- else return c;
- }
- }
Add Comment
Please, Sign In to add comment