当前位置:网站首页>[PTA] 7-19 check face value (15 points)
[PTA] 7-19 check face value (15 points)
2022-07-25 22:52:00 【Panzer_ Jack】
A buyer went to the bank to exchange a y element f Split check , As a result, the cashier gave it to f element y branch . The buyer used n I didn't find anything wrong until I got a score , So I counted the balance and there was still 2y element 2f branch , Ask what the face value of the check is ?
Input format :
The input gives less than... On one line 100 The positive integer n.
Output format :
In one line by format y.f Output the original face value of the check . If there is no solution , The output No Solution.
Examples 1:"> sample input 1:
23
sample output 1:
25.51
sample input 2:
22
sample output 2:
No Solution
#include <stdio.h>
int main(void)
{
int y=0, f=0, n, flag=0;
scanf("%d", &n);
// f*100 + y - n == 2*y*100 + 2*f
for (f = 0; f*100 + y - n != 2*y*100 + 2*f; f++)
{
if (f==100)
{
f = 0;
y++;
}
if (y==100)
{
flag = 1;
break;
}
}
if (flag == 1)
{
printf("No Solution");
}
else
{
printf("%d.%d", y, f);
}
return 0;
}边栏推荐
- Deep recursion, deep search DFS, backtracking, paper cutting learning.
- [natural language processing] [vector representation] augsbert: improve the data enhancement method of Bi encoders for paired sentence scoring tasks
- invalid syntax
- Compiler introduction
- Learning orientation today
- 【集训DAY12】X equation 【高精度】【数学】
- access-list vs ip access-list
- Understanding of forward proxy and reverse proxy
- What is the difference between bio, NiO and AIO?
- What are the differences between FileInputStream and bufferedinputstream?
猜你喜欢

QT Chinese programming encounters c2001 error, prompting "there is a newline character in the constant"

QT的Tree View Model示例
![[literature reading] - HRL -[hrl with universal policies for multi step robotic control]](/img/34/06d5ba3af4e6e775a335324c020161.png)
[literature reading] - HRL -[hrl with universal policies for multi step robotic control]

MatrixCube揭秘102——300行实现的完整分布式存储系统MatrixKV

CMU AI PhD first year summary

Express framework

Examples and points for attention about the use of getchar and scanf

Network Security Learning (16)

Interview question 17.11. word distance ●●

Kibana~后台启动Kibana之后无法找到进程号
随机推荐
Anaconda~Upload did not complete.
PE format: analyze and implement IATHOOK
Network Security Learning (XIV) IP protocol
Short circuit and &, short circuit or |, logic and &, logic or |; Conditional operator
Compiler introduction
The difference between "rewrite" and "overload"
Similarities and differences between equals and "= ="
新媒体运营策略(以小红书为例)帮助你快速掌握爆款创作方法
【PMP学习笔记】第1章 PMP体系引论
我们为什么要推出Getaverse?
JVM memory area
码蹄集 万民堂大厨
JS makes elements get or lose focus
Stack simulation queue
【集训DAY11】Calc【数学】
Solve several common problems
[training day15] boring [tree DP]
Day006 select structure (if statement exercise)
Binder原理
Structure principle of micro ball vibration switch with chip