当前位置:网站首页>7-19 check denomination (solve binary linear equation)
7-19 check denomination (solve binary linear equation)
2022-07-03 14:14:00 【Big fish】
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.
sample input 1:
23
sample output 1:
25.51
sample input 2:
22
sample output 2:
No SolutionBrute force :
#include<stdio.h>
int main()
{
int n,y=0,f=0;
scanf("%d",&n);
//98f-n=199y;
int i=0;
for(y=0;y<100;y++)
{
for(f=0;f<100;f++)
{
if(98*f-n==199*y)
{
printf("%d.%d",y,f);
i=1;
}
}
}
if(i!=1)
printf("No Solution\n");
return 0;
}
边栏推荐
猜你喜欢

JVM class loading

剑指 Offer 28. 对称的二叉树

NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线

7-9 find a small ball with a balance

556. 下一个更大元素 III

信创产业现状、分析与预测

Generate directories from web content

小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。

Current situation, analysis and prediction of information and innovation industry

allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取
随机推荐
Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
JS new challenges
jvm-运行时数据区
Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs
中国锂电池电解液行业市场专项调研报告(2022版)
泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
Exercise 10-3 recursive implementation of exponential functions
LNMP环境mail函数不能发送邮件解决
Exercise 6-1 classify and count the number of characters
Print. JS -- web page file printing
JS first summary
JS matrix zero
中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿
How to delete an attribute or method of an object
Raft 协议
JVM runtime data area
7-8 overspeed judgment
Raft agreement
Exercise 8-7 string sorting