标签:while style scan i++ pre for code ota ++
#include<stdio.h> int main() { int n; int i; int mny[200]; int hund,fifty,ten,five,two,one; int total; while(~scanf("%d",&n)) { total =0; if(n==0) break; for(i=1;i<=n;i++) { scanf("%d",&mny[i]); } for(i=1;i<=n;i++) { hund=mny[i]/100; fifty=(mny[i]-100*hund)/50; ten=(mny[i]-100*hund-50*fifty)/10; five=(mny[i]-100*hund-10*ten-50*fifty)/5; two=(mny[i]-100*hund-50*fifty-10*ten-5*five)/2; one=mny[i]-100*hund-50*fifty-10*ten-5*five-2*two; total=total+hund+fifty+ten+five+two+one; } printf("%d\n",total); } }
标签:while style scan i++ pre for code ota ++
原文地址:https://www.cnblogs.com/dlwpkr/p/9991891.html