Fork me on GitHub

NYOJ题目1082买新书了

--------------------------------------------

需要注意的可能就是余数。

 

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

posted @ 2016-09-16 02:23  CC11001100  阅读(123)  评论(0编辑  收藏  举报