标签:防止 output open return closed panel 包含 can 多少
Input
输入数据的第一行是一个整数T(1<=T<=100),代表测试数据的数量.然后是T行测试数据,每个测试数据只包含一个正整数N(1<=N<=10000),N代表死亡骑士手中钞票的面值.
注意:地精商店只有题中描述的三种道具.
Output
对于每组测试数据,请你输出死亡骑士最少要浪费多少钱给地精商人作为小费.
Sample Input
2 900 250
Sample Output
0 50
// 350=150+200,200=150+50. 详见代码
1 #include<stdio.h> 2 int main() 3 { 4 int t,n, tip; 5 scanf("%d", &t); 6 while(t--) 7 { 8 scanf("%d", &n); 9 int s1=n%150, s2=n/150; 10 if(s1/50>s2) tip=n-200*s2; 11 else tip=s1-s1/50*50; 12 printf("%d\n", tip); 13 } 14 return 0; 15 }
标签:防止 output open return closed panel 包含 can 多少
原文地址:https://www.cnblogs.com/goldenretriever/p/10357084.html