AcWing 653. 钞票 - Java
原题链接
中等
作者:
KYCygni
,
2021-03-07 00:57:17
,
所有人可见
,
阅读 348
Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int n = cin.nextInt();
System.out.println( n );
System.out.println( n / 100 + " nota(s) de R$ 100,00");
n = n % 100;
System.out.println( n / 50 + " nota(s) de R$ 50,00");
n = n % 50;
System.out.println( n / 20 + " nota(s) de R$ 20,00");
n = n % 20;
System.out.println( n / 10 + " nota(s) de R$ 10,00");
n = n % 10;
System.out.println( n / 5 + " nota(s) de R$ 5,00");
n = n % 5;
System.out.println( n / 2 + " nota(s) de R$ 2,00");
n = n % 2;
System.out.println( n + " nota(s) de R$ 1,00");
}
}