1 /*
2 * Main.c
3 * C9-循环-09. 支票面额
4 * Created on: 2014年7月28日
5 * Author: Boomkeeper
6 ********测试通过**********
7 */
8
9 #include<stdio.h>
10
11 int main(void) {
12 int n = 0;
13 int y, f;
14
15 scanf("%d", &n);
16
17 for (f = 0; f < 100; f++) {
18 for (y = 0; y <= (98 * f - n) / 199; y++) {
19 if (98 * f - 199 * y == n) {
20 printf("%d.%d\n", y, f);
21 return 0;
22 }
23 }
24 }
25 printf("No Solution\n");
26
27 return 0;
28 }
题目链接:
http://pat.zju.edu.cn/contests/basic-programming/%E5%BE%AA%E7%8E%AF-09
原文链接: https://www.cnblogs.com/boomkeeper/p/C9.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/139498
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!