当前位置:网站首页>阿凡提的难题
阿凡提的难题
2022-08-03 05:10:00 【-JMY-】
题目描述
阿凡提去集市上买餐具,财主正好在卖餐具,所以准备为难一下阿凡提;财主的餐具有2种:大碗和小碗,财主和阿凡提说,你买我的碗,要花光你带的钱,而且,两种碗都要买,买的两种碗的数量都得是偶数,请你编程帮助阿凡提计算,可以有哪些购买的方案呢?
输入
三个整数,分别代表了阿凡提带的钱的数量,大碗的价格,小碗的价格!
输出
所有的购买方案,一行一个方案,先输出大碗的采购只数,再输出小碗的采购只数!(大碗数量少的方案在前)
样例输入
100 20 10
样例输出
2 6 4 2
参考代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
int k,b,s;
cin>>k>>b>>s;
for(int i=2;i<=k;i+=2){
for(int j=2;j<=k;j+=2){
if(i*b+j*s==k)
cout<<i<<' '<<j<<'\n';
}
}
}
边栏推荐
- Newifi路由器第三方固件玩机教程,这个路由比你想的更强大以及智能_Newifi y1刷机_smzdm
- 曲线特征----曲线弯曲程度的探究
- 1060 爱丁顿数 (25 分)
- ss-1.curl (cloud-provider-payment8001)
- 【Biotin Azide|cas:908007-17-0】Price_Manufacturer
- HarmonyOS应用开发第一次培训
- How to prepare for the test interface test data
- celery工作原理图
- Interface testing framework of actual combat (2) | interface request assertion
- 2. 两数相加
猜你喜欢

typescript39-class类的可见修饰符

Modified BiotinDIAZO-Biotin-PEG3-DBCO|diazo-biotin-tripolyethylene glycol-diphenylcyclooctyne
![[Harmony OS] [ArkUI] ets development graphics and animation drawing](/img/36/f4c91f794b1321f11a24505d1617fb.png)
[Harmony OS] [ArkUI] ets development graphics and animation drawing

13.
lt.647. Palindromic substring + lt.516. Longest palindrome subsequence 
【特征选取】计算数据点曲率

用scikit-learn学习谱聚类

How to prepare for the test interface test data

第三次HarmonyOS培训

Coordinate knowledge in digital twin campus scenarios

第四次培训
随机推荐
Harmony OS ets ArkUI 】 【 】 the development basic page layout and data connection
高可用 两地三中心
信息编码、存储压缩与密码学
力扣561. 数组拆分
VR全景展打造专属元宇宙观展空间
2017-06-11 Padavan 完美适配newifi mini【adbyby+SS+KP ...】youku L1 /小米mini
【Flask】Flask-SQLAlchemy的增删改查(CRUD)操作
UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors
1069 微博转发抽奖 (20 分)(C语言)
Common lipophilic cell membrane dyes DiO, Dil, DiR, Did spectrograms and experimental procedures
MySql数据库
Power button 561. An array of split
ss-1.curl (cloud-provider-payment8001)
Object类与常用API
4.如何避免缓存穿透、缓存击穿、缓存雪崩
typescript46-函数之间的类型兼容性
Flask的简单介绍及使用方法简介
Technology Sharing | How to do assertion verification for xml format in interface automation testing?
Tributyl-mercaptophosphane "tBuBrettPhos Pd(allyl)" OTf), 1798782-17-8
生活原则。