当前位置:网站首页>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;
}
边栏推荐
- js 2023. String pair equal to the target string after connection
- Doxorubicin loaded on metal organic framework MIL-88 DOX | folic acid modified uio-66-nh2 doxorubicin loaded [email
- 关于回溯问题中的排列问题的思考(LeetCode46题与47题)
- JS continues to explore...
- JVM runtime data area
- Although not necessarily the best, it must be the hardest!
- selenium 浏览器(1)
- [Jilin University] information sharing of postgraduate entrance examination and re examination
- 战略、战术(和 OKR)
- 556. 下一个更大元素 III
猜你喜欢

Exercise 9-1 time conversion

Uio-66-cooh loaded bendamostine | hydroxyapatite (HA) coated MIL-53 (FE) nanoparticles | baicalin loaded manganese based metal organic skeleton material

愉悦资本新双币基金近40亿元完成首次关账

FPGA test method takes mentor tool as an example

Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs

“又土又穷”的草根高校,凭什么被称为“东北小清华”?

编程语言:类型系统的本质

Global event bus

jvm-运行时数据区

Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
随机推荐
Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
7-2 and then what time (15 minutes)
6-9 statistics of single digits (15 points)
Exercise 6-6 use a function to output an integer in reverse order
7-11 calculation of residential water charges by sections
7-8 overspeed judgment
Raft agreement
Leetcode (4) - - trouver la médiane de deux tableaux ordonnés positifs
QT learning 20 standard dialog box in QT (middle)
Jiuyi cloud black free encryption free version source code
Exercise 8-7 string sorting
修改数据库中的记录为什么报这个错
C library function - qsort()
JVM garbage collector
Current situation, analysis and prediction of information and innovation industry
Why don't I have a rookie medal
Configure stylelint
allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取
Example analysis of QT learning 18 login dialog box
Common plug-ins for vite project development