当前位置:网站首页>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 Solution
Brute 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 17 dialog box and its types
- Exercise 10-1 calculate the sum of 1 to n using recursive functions
- 7-15 calculation of PI
- 全局事件总线
- jvm-类加载
- SSH访问控制,多次失败登录即封掉IP,防止暴力破解
- Print. JS -- web page file printing
- Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
- Doxorubicin loaded on metal organic framework MIL-88 DOX | folic acid modified uio-66-nh2 doxorubicin loaded [email
- 战略、战术(和 OKR)
猜你喜欢
Redis: redis data structure and key operation commands
Exercise 6-2 using functions to sum special A-string sequences
Metal organic framework (MOFs) antitumor drug carrier | pcn-223 loaded with metronidazole | uio-66 loaded with ciprofloxacin hydrochloride(
小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。
JVM runtime data area
FPGA test method takes mentor tool as an example
Exercise 9-1 time conversion
Mysql多表查询 #子查询
[email "/>
Doxorubicin loaded on metal organic framework MIL-88 DOX | folic acid modified uio-66-nh2 doxorubicin loaded [email
修改数据库中的记录为什么报这个错
随机推荐
Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
Although not necessarily the best, it must be the hardest!
Vite project commissioning
Redis: redis data structure and key operation commands
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
7-8 overspeed judgment
6-9 statistics of single digits (15 points)
JVM runtime data area
JVM garbage collector
信创产业现状、分析与预测
Exercise 8-8 moving letters
Facebook 如何将 Instagram 从 AWS 搬到自己的服务器
泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
Page generation QR code
Redis: commandes d'action pour les données de type chaîne
LNMP环境mail函数不能发送邮件解决
常见问题之PHP——ldap_add(): Add: Undefined attribute type in
7-10 calculate salary