20-22 AC 23 WA

This commit is contained in:
xice09
2018-08-01 12:25:28 +08:00
parent cc6cf4cdea
commit 813bd54652
4 changed files with 92 additions and 0 deletions

19
2021.cpp Normal file
View File

@@ -0,0 +1,19 @@
#include <iostream>
using namespace std;
int main(){
int n;
while (cin >> n && n!=0){
int r100=0,r50=0,r10=0,r5=0,r2=0,r1=0,tmp;
for(;n>0;n--){
cin >> tmp;
for(;tmp>=100;tmp-=100) r100++;
for(;tmp>=50;tmp-=50) r50++;
for(;tmp>=10;tmp-=10) r10++;
for(;tmp>=5;tmp-=5) r5++;
for(;tmp>=2;tmp-=2) r2++;
for(;tmp>=1;tmp-=1) r1++;
}
cout << r100+r50+r10+r5+r2+r1 << endl;
}
return 0;
}