九度OJ 1549 货币有关问题 (模拟)
九度OJ 1549 货币问题 (模拟)
题目1549:货币问题
#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 ****************************************************************/