当前位置:网站首页>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;
}边栏推荐
- 【网络攻防实训习题】
- 037 PHP login, registration, message, personal Center Design
- 一图看懂!为什么学校教了你Coding但还是不会的原因...
- How to get all sequences in Oracle database- How can I get all sequences in an Oracle database?
- False breakthroughs in the trend of London Silver
- MATLB|实时机会约束决策及其在电力系统中的应用
- ThreeDPoseTracker项目解析
- 晶振是如何起振的?
- Docker compose configures MySQL and realizes remote connection
- VMware Tools安装报错:无法自动安装VSock驱动程序
猜你喜欢

Accelerating spark data access with alluxio in kubernetes

MATLB|实时机会约束决策及其在电力系统中的应用

Maya hollowed out modeling

Poj2315 football games

Initialize MySQL database when docker container starts

c#网页打开winform exe

Une image! Pourquoi l'école t'a - t - elle appris à coder, mais pourquoi pas...

3D vision - 4 Getting started with gesture recognition - using mediapipe includes single frame and real time video

How does the crystal oscillator vibrate?

Docker compose configures MySQL and realizes remote connection
随机推荐
A Cooperative Approach to Particle Swarm Optimization
Code review concerns
Mongodb problem set
【Flask】官方教程(Tutorial)-part1:项目布局、应用程序设置、定义和访问数据库
2022 Guangxi Autonomous Region secondary vocational group "Cyberspace Security" competition and its analysis (super detailed)
剑指 Offer 38. 字符串的排列
Paddle框架:PaddleNLP概述【飞桨自然语言处理开发库】
UE4 unreal engine, editor basic application, usage skills (IV)
Basic operations of database and table ----- delete data table
Leetcode skimming questions_ Sum of squares
PHP error what is an error?
Folio.ink 免费、快速、易用的图片分享工具
[Yu Yue education] Liaoning Vocational College of Architecture Web server application development reference
Docker compose configures MySQL and realizes remote connection
[technology development -28]: overview of information and communication network, new technology forms, high-quality development of information and communication industry
Alibaba-Canal使用详解(排坑版)_MySQL与ES数据同步
ThreeDPoseTracker项目解析
【Flask】静态文件与模板渲染
leetcode刷题_反转字符串中的元音字母
[le plus complet du réseau] | interprétation complète de MySQL explicite