--------------------------------------------
需要注意的可能就是余数。
AC代码:
1 import java.util.Scanner; 2 3 public class Main { 4 5 public static void main(String[] args) { 6 7 Scanner sc=new Scanner(System.in); 8 9 int tiems=sc.nextInt(); 10 while(tiems-->0){ 11 int t1=sc.nextInt(); 12 int t2=sc.nextInt(); 13 int ans=t1/t2+(t1/t2*t2==t1?0:1); 14 System.out.println(ans); 15 } 16 17 } 18 19 }
题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=1082
时间: 2024-10-22 01:15:09