当前位置:网站首页>D22:indeterminate equation (indefinite equation, translation + problem solution)
D22:indeterminate equation (indefinite equation, translation + problem solution)
2022-07-06 01:34:00 【Aggressive Wenwen】
The original title is :OpenJudge - 22:Indeterminate Equation
translate :
describe : Given A,B and C. seek X and Y, send A ride X Add B ride Y be equal to C.
Input : Three not greater than 100 The positive integer A,B,C;
Output : Two integers X and Y.
Code : There is something wrong with this question .. Because there is only one set of samples , And there are other equal cases , such as 4*(-99)+7*58=10,4*(-8)+7*6=10 etc. , So it's better to output directly "-1 2"...
#include<iostream>
using namespace std;
int main()
{
int a,b,c,f=1;
int i,j;
cin>>a>>b>>c;
for(i=-5;i<101&&f;i++)
for(j=-5;j<101&&f;j++)
if(a*i+b*j==c){
cout<<i<<" "<<j<<endl;
f=0;
}
return 0;
}
边栏推荐
- CocoaPods could not find compatible versions for pod 'Firebase/CoreOnly'
- 现货白银的一般操作方法
- TrueType字体文件提取关键信息
- Test de vulnérabilité de téléchargement de fichiers basé sur dvwa
- [flask] official tutorial -part3: blog blueprint, project installability
- MATLB | real time opportunity constrained decision making and its application in power system
- Alibaba canal usage details (pit draining version)_ MySQL and ES data synchronization
- Leetcode 剑指 Offer 59 - II. 队列的最大值
- 02.Go语言开发环境配置
- Docker compose configures MySQL and realizes remote connection
猜你喜欢
Recommended areas - ways to explore users' future interests
Folio. Ink is a free, fast and easy-to-use image sharing tool
【Flask】官方教程(Tutorial)-part2:蓝图-视图、模板、静态文件
[understanding of opportunity-39]: Guiguzi - Chapter 5 flying clamp - warning 2: there are six types of praise. Be careful to enjoy praise as fish enjoy bait.
Test de vulnérabilité de téléchargement de fichiers basé sur dvwa
Mongodb problem set
How does the crystal oscillator vibrate?
晶振是如何起振的?
Poj2315 football games
dried food! Accelerating sparse neural network through hardware and software co design
随机推荐
500 lines of code to understand the principle of mecached cache client driver
Internship: unfamiliar annotations involved in the project code and their functions
[le plus complet du réseau] | interprétation complète de MySQL explicite
Unity | two ways to realize facial drive
[flask] response, session and message flashing
Leetcode 208. Implement trie (prefix tree)
Redis-Key的操作
Reasonable and sensible
ORA-00030
黄金价格走势k线图如何看?
[network attack and defense training exercises]
Leetcode1961. 检查字符串是否为数组前缀
一图看懂!为什么学校教了你Coding但还是不会的原因...
Unity | 实现面部驱动的两种方式
Une image! Pourquoi l'école t'a - t - elle appris à coder, mais pourquoi pas...
Netease smart enterprises enter the market against the trend, and there is a new possibility for game industrialization
Alibaba-Canal使用详解(排坑版)_MySQL与ES数据同步
Basic process and testing idea of interface automation
XSS learning XSS lab problem solution
3D模型格式汇总