Problem description
Xiao Ming takes n yuan to buy soy sauce. Soy sauce 10 yuan a bottle, merchants to promote, each buy 3 bottles to send 1 bottles, or 5 bottles per buy to send 2 bottles. How many bottles of soy sauce can I get, xiaoming?
Input format
The first line of input contains an integer n, which indicates the amount of money that xiaoming can use to buy soy sauce. n is an integer multiple of 10, and N does not exceed 300.
Output format
Output an integer indicating how many bottles of soy sauce The xiaoming can get.
Sample input
Sample Output 5
Sample Description
40 yuan into 30 yuan and 10 yuan, respectively, to buy 3 bottles and 1 bottles, of which 3 bottles to send 1 bottles, a total of 5 bottles.
Sample input
Sample Output
Sample Description
80 yuan into 30 yuan and 50 yuan, respectively, to buy 3 bottles and 5 bottles, of which 3 bottles to send 1 bottles, 5 bottles to send 2 bottles, a total of 11 bottles.
package com.
cavellchance.learning;
Import Java.util.Scanner;
public class Buysomesauce {public static int bigsale (int m) {int bottle5 = M/50;
int bottle5left = m% 50;
int bottle3 = BOTTLE5LEFT/30;
int bottle3left = bottle5left% 30;
int bottle1 = BOTTLE3LEFT/10;
int bottles = Bottle5 * 7 + bottle3 * 4 + bottle1 * 1;
return bottles;
public static void Main (String args[]) {int ' money = 0;
Scanner Scanner = new Scanner (system.in);
if (Scanner.hasnextint ()) {money = Scanner.nextint ();
} System.out.println (Bigsale (money)); }
}