-
Notifications
You must be signed in to change notification settings - Fork 0
/
996A.cpp
51 lines (40 loc) · 796 Bytes
/
996A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
cout<<n/100+(n%100)/20+(n%20)/10+(n%10)/5+(n%5)/1;
}
/////////////////////////////////////////////////////////////
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,count=0;
cin>>n;
while (n!=0)
{
if(n>=1 && n<5){
count+=n/1;
n=n%1;
}
if(n>=5 && n<10){
count+=n/5;
n=n%5;
}
if(n>=10 && n<20){
count+=n/10;
n=n%10;
}
if(n>=20 && n<100){
count+=n/20;
n=n%20;
}
if(n>100){
count+=n/100;
n=n%100;
}
}
cout<<count<<endl;
}