Javaシロのあるアップルストアはアップルに小銭を探さない習慣があり、アップルの価格は500グラム当たり2.49元で、アップルストアは顧客がアップルを購入する数を入力した後、これらのアップルの四捨五入されていない総価格と顧客の対応金額を出力した.
import java.util.Scanner;
class IntFunction
{
double Sell = 500;
void yuio()
{
System.out.println(" ");
Scanner sc = new Scanner(System.in);
double word = sc.nextDouble();
double mokey = (word/Sell)*2.49;
System.out.println(Math.rint(mokey));
System.out.println(mokey);
}
}
class Main
{
public static void main(String[] args)
{
IntFunction a = new IntFunction();
a.yuio();
}
}