标签:pid main img isp iostream ble closed int open
#include<iostream> #include<stdio.h> #include<string.h> #include<algorithm> #include<math.h> using namespace std; int a[6]={100,50,10,5,2,1}; int num(int x) { int sum=0; for(int i = 0;i< 6;i++) { int t = x/a[i]; sum+=t; x = x- t*a[i]; } return sum; } int main() { int n,a; while(cin>>n) { if(n==0) break; int count = 0; for(int i = 0;i< n;i++) { cin>>a; count+=num(a); } cout<<count<<endl; } return 0; }
标签:pid main img isp iostream ble closed int open
原文地址:https://www.cnblogs.com/lyqf/p/9737889.html