You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
456 B
C++
23 lines
456 B
C++
#include <cstdio>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
int n;
|
|
while(scanf("%d",&n),n)
|
|
{
|
|
int ans=0;
|
|
for(int i=0,tmp;i<n;i++)
|
|
{
|
|
scanf("%d",&tmp);
|
|
ans+=tmp/100,tmp%=100;
|
|
ans+=tmp/50,tmp%=50;
|
|
ans+=tmp/10,tmp%=10;
|
|
ans+=tmp/5,tmp%=5;
|
|
ans+=tmp/2,tmp%=2;
|
|
ans+=tmp;
|
|
}
|
|
printf("%d\n",ans);
|
|
}
|
|
return 0;
|
|
}
|