题解 | #计算带余除法#

计算带余除法

http://www.nowcoder.com/practice/34d3911bf2fd48a285f6396e886a1259

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        String[] nums = str.split(" ");
        int a = Integer.parseInt(nums[0]);//string转int
        int b = Integer.parseInt(nums[1]);
        int quotient = a / b;
        int remainder = a % b;
        System.out.println(quotient + " " + remainder);
    }
}
全部评论

相关推荐

不愿透露姓名的神秘牛友
07-11 15:37
点赞 评论 收藏
分享
06-23 10:26
佳木斯大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务