hdu-1248-寒冰王座

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1248

程序:

#include<iostream>
using namespace std;
int main()
{
int a,b,n,m,i;
cin>>n;
while(n--)
{
cin>>m;
a=m/150;
b=m%150; // 最小的 道具师150 所以就看看钱里面总共有多少个150
while(a--&&b>=50)
{
b-=50; // 因为200是150的一倍加 50,350是 150 的 2倍加 50
} //所以只要看看剩下的有几个 50,就可以了。
cout<<b<<endl; //注意:50 的个数一定是小于等于 150的个数的。
}
return 0;
}

原文地址:https://www.cnblogs.com/zhouhongweihpu/p/3877266.html