码迷,mamicode.com
首页 > 其他好文 > 详细

2021.发工资咯:)

时间:2018-10-03 22:00:15      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:using   cst   font   while   amp   name   soft   main   ros   

#include<cstdio>

#include<iostream>

using namespace std;

int main(){

         int n;

         while(scanf("%d",&n),n){

                   int d,ans=0;

                   for(int i=0;i<n;i++){

                            scanf("%d",&d);

                            ans+=d/100;d%=100;

                            ans+=d/50;d%=50;

                            ans+=d/10;d%=10;

                            ans+=d/5;d%=5;

                            ans+=d/2;d%=2;

                            ans+=d;

                   }

                   printf("%d\n",ans);

         }

         return 0;

}

2021.发工资咯:)

标签:using   cst   font   while   amp   name   soft   main   ros   

原文地址:https://www.cnblogs.com/huoyuying/p/9738828.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!