[Java] Xiaoyu buy stationery

Xiaoyu buy stationery

Title Description
teacher Xiaoyu gave a mandate to the stationery store to buy as much of the pen. A pen known price is $ 1 9 angle, and the teacher gave Xiaoyu money is a dollar b angle, Xiaoyu want to know how much she can only buy up to pen it.

Input format
data input, one line, comprising two integers, and in turn represents a b, a <= 10000, b <= 9.

Output format
output an integer representing the maximum number of Xiaoyu can buy only pen.

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try(Scanner input=new Scanner(System.in)){
			int a=input.nextInt();
			int b=input.nextInt();
			System.out.println((a*10+b)/19);
		}
	}
}
Published 34 original articles · won praise 22 · views 1698

Guess you like

Origin blog.csdn.net/weixin_46014378/article/details/104568697