晴天 • 2个月前
using namespace std;
int main () {
int n, m, x, y, f = 0;
cin >> n >> m;
for (x = 0; x <= n; x++) {
for (y = 0; y <= n; y++ ) {
if (x + y == n && x * 2 + y * 4 == m) {
f = 1;
cout << x << " " << y<<endl ;
}
}
}
if (f == 0) {
cout << "NULL";
}
return 0;
}
评论:
请先登录,才能进行评论