解
2024-05-20 16:38:15
发布于:浙江
这样做的:
#include <iostream>
using namespace std;
int main() {
int x, y;
if (cin >> x >> y && 1 <= x && x <= 1000 && 1 <= y && y <= 1000) {
int a = 4 * x - y;
int b = a / 2;
if (a % 2 == 0 && b >= 0 && b <= x) {
cout << b << endl << x - b << endl;
} else {
cout << "No solution" << endl;
}
} else {
cout << "Invalid input" << endl;
}
return 0;
}
全部评论 4
#include<bits/stdc++.h>
//</>
using namespace std;
int main()
{
int x,y;
cin >> x >> y;
int a = x * 2;
int tu = (y - a) / 2;
int ji = x - tu;
cout << ji << endl << tu;
return 0;
}1周前 来自 浙江
0没有必要写那么长
2025-04-02 来自 辽宁
06666666666666666666666666666666666666666666666666666666666666666666666666666666
2024-10-10 来自 浙江
0#include <bits/stdc++.h>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
int a=(x*4)-y;
int b=(a/2);
cout<<b<<endl<<x-b;
return 0;
}2024-05-20 来自 浙江
0









有帮助,赞一个