解题思路:
注意事项:
参考代码:
#include <iostream> using namespace std; int main(){ int n,t; while(cin>>n&&n){ int count=0; for(int i=0;i<n;i++){ cin>>t; while(t){ if(t>=100){ t-=100; count++; } else if(t>=50){ t-=50; count++; } else if(t>=10){ t-=10; count++; } else if(t>=5){ t-=5; count++; } else if(t>=2){ t-=2; count++; } else { t-=1; count++; } } } cout<<count<<endl; } return 0; }
0.0分
2 人评分
C语言程序设计教程(第三版)课后习题11.3 (C语言代码)浏览:739 |
C语言训练-斐波纳契数列 (C语言代码)浏览:1174 |
九宫重排 (C++代码)浏览:1336 |
C语言训练-角谷猜想 (C语言代码)浏览:1710 |
C语言程序设计教程(第三版)课后习题7.1 (C语言代码)浏览:735 |
C语言程序设计教程(第三版)课后习题11.5 (C语言代码)浏览:904 |
多输入输出练习1 (C语言代码)浏览:1189 |
上车人数 (C语言代码)浏览:781 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:540 |
WU-格式化数据输出 (C语言代码)浏览:1755 |