题目描述
某学校植树节开展植树活动,已知树苗有m株,参加植树的同学有n人(且m>n),请问每位同学平均可以植树几株?还有几株剩余?
输入
输入两个整数m和n,分别表示树苗的数量和学生的人数(m>n)。
输出
输出两个整数,分别表示每位同学平均植树的数量及剩余的树苗数量。
样例输入 Copy
163 32样例输出 Copy
5 3来源/分类
http://acm.zzuli.edu.cn/problem.php?id=1001
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner in =new Scanner(System.in);
//树苗的数目和学生的数目都是整数
int a,b;
a=in.nextInt();//树苗
b=in.nextInt();//学生
System.out.println(a/b+" "+a%b);
}
}