AcWing 611. 简单计算 - Java
原题链接
简单
作者:
KYCygni
,
2021-02-28 00:18:42
,
所有人可见
,
阅读 334
Java 代码
/**4 MDKJ
"The old question 'Is it in the database?' will be replaced by 'Is it on the blockchain?'"
-- William Mougayar
*/
import java.util.Scanner;
public class Main
{
public static void main (String[] args)
{
Scanner cin = new Scanner(System.in);
double total = 0;
for (int i = 0; i < 2; i ++)
{
cin.nextInt(); // product #
total += cin.nextInt() * cin.nextDouble();
}
System.out.println ("VALOR A PAGAR: R$ " + String.format("%.2f", total));
}
}