标签:des style blog io color ar sp 数据 div
1 #include <stdio.h> 2 3 int get_amount(int salary); 4 5 int main(){ 6 int number; 7 int salary; 8 int total_amount; 9 10 while(1){ 11 scanf("%d",&number); 12 13 if(number==0) 14 break; 15 16 total_amount=0; 17 while(number--){ 18 scanf("%d",&salary); 19 20 total_amount+=get_amount(salary); 21 } 22 23 printf("%d\n",total_amount); 24 } 25 26 return 0; 27 } 28 29 int get_amount(int salary){ 30 int amount=0; 31 32 while(salary){ 33 if(salary>=100) 34 salary-=100; 35 36 37 else if(salary>=50) 38 salary-=50; 39 40 else if(salary>=10) 41 salary-=10; 42 43 else if(salary>=5) 44 salary-=5; 45 46 else if(salary>=2) 47 salary-=2; 48 49 else if(salary>=1) 50 salary-=1; 51 52 amount++; 53 54 } 55 56 return amount; 57 }
标签:des style blog io color ar sp 数据 div
原文地址:http://www.cnblogs.com/zqxLonely/p/4056540.html