当前位置:网站首页>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;
}
边栏推荐
- QT learning 21 standard dialog box in QT (Part 2)
- Why don't I have a rookie medal
- JS Part 2
- “又土又穷”的草根高校,凭什么被称为“东北小清华”?
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
- Exercise 8-2 calculate the sum and difference of two numbers
- 战略、战术(和 OKR)
- 7-16 find the set of integers that meet the given conditions
- JS input number and standard digit number are compared. The problem of adding 0 to 0
- Invalid Z-index problem
猜你喜欢

Exercise 10-3 recursive implementation of exponential functions

Eight sorts

Jiuyi cloud black free encryption free version source code

GRPC的四种数据流以及案例

Metal organic framework MOFs loaded with non steroidal anti-inflammatory drugs | zif-8 wrapped Prussian blue loaded quercetin (preparation method)

Mysql多表查询 #子查询

Exercise 8-8 moving letters

Generate directories from web content

Interface for querying IP home

JS input number and standard digit number are compared. The problem of adding 0 to 0
随机推荐
Invalid Z-index problem
How to bold text in AI
常见问题之PHP——ldap_add(): Add: Undefined attribute type in
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
28: Chapter 3: develop Passport Service: 11: define attributes in the configuration file, and then obtain them in the code;
Similarities and differences of sessionstorage, localstorage and cookies
Strategy, tactics (and OKR)
How to delete an attribute or method of an object
Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
Leetcode (4) -- find the median of two positively ordered arrays
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
全局事件总线
page owner特性浅析
Current situation, analysis and prediction of information and innovation industry
八大排序
Exercise 8-2 calculate the sum and difference of two numbers
Simulated access
Nucleic acid modified metal organic framework drug carrier | pcn-223 metal organic framework encapsulated ad adamantane | zif-8 encapsulated adriamycin (DOX)
Redis: operation command of string type data
Exercise 10-6 recursively find Fabonacci sequence