#include<stdio.h> int p; int main(int argc, char *argv[]) { while(~scanf("%d",&p)){ int cnt=0; cnt+=p/100; p%=100; cnt+=p/50; p%=50; cnt+=p/20; p%=20; cnt+=p/10; p%=10; cnt+=p/5; p%=5; cnt+=p/2; p%=2; cnt+=p%2; printf("%d\n",cnt); } return 0; } /************************************************************** Problem: 1549 User: kirchhoff Language: C Result: Accepted Time:20 ms Memory:912 kb ****************************************************************/
原文地址:http://blog.csdn.net/wdkirchhoff/article/details/42079703