
Banknotes
Adapted by Neilor Tonin, URI Brazil
In this problem you have to read an integer value and calculate the smallest possible number of banknotes in which the value may be decomposed. The possible banknotes are 100, 50, 20, 10, 5, 2 e 1. Print the read value and the list of banknotes.
Input
The input file contains an integer value N (0 < N < 1000000).
Output
Print the read number and the minimum quantity of each necessary banknotes in Portuguese language, as the given example. Do not forget to print the end of line after each line, otherwise you will receive “Presentation Error”.
Input Sample | Output Sample |
576 |
576 |
11257 |
11257 |
503 |
503 |
URI - BEECROWD Online Judge 1018 Solve in C :
//Solved by Intesar#include <stdio.h>
int main() {
int n; scanf("%d",&n); printf("%d\n",n); printf("%d nota(s) de R$ 100,00\n",n/100); n=n%100; printf("%d nota(s) de R$ 50,00\n",n/50); n=n%50; printf("%d nota(s) de R$ 20,00\n",n/20); n=n%20; printf("%d nota(s) de R$ 10,00\n",n/10); n=n%10; printf("%d nota(s) de R$ 5,00\n",n/5); n=n%5; printf("%d nota(s) de R$ 2,00\n",n/2); n=n%2; printf("%d nota(s) de R$ 1,00\n",n/1); n=n%1; return 0;}
0 Comments