题目:
有m名学生,每n人用1张课桌,需要多少张课桌?把这些课桌平均放在z间教室里,每间教室放多少张?
样例输入:90 2 3
样例输出:45 15
package com.item.action; import java.util.Scanner; /** * * @author hongmuxiangxun 红目香薰 付文龙 老师付 laoshifu * */ public class demo2 { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int m = sc.nextInt(); int n = sc.nextInt(); int z = sc.nextInt(); sc.close(); int count=m/n; if(m%n>0) { count++; } int classCount=count/z; if(count%classCount>0) { classCount++; } System.out.println(count+" "+classCount); } }