mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
P1618 三连击(升级版)
R69124401
This commit is contained in:
parent
4891eda3cc
commit
e39944305a
28
Luogu/P1618/P1618.cpp
Normal file
28
Luogu/P1618/P1618.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
#define endl '\n'
|
||||
|
||||
int a, b, c,
|
||||
f[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
|
||||
bool flag = false;
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin >> a >> b >> c;
|
||||
do {
|
||||
int aa = f[0] * 100 + f[1] * 10 + f[2],
|
||||
bb = f[3] * 100 + f[4] * 10 + f[5],
|
||||
cc = f[6] * 100 + f[7] * 10 + f[8];
|
||||
if (aa * b == bb && aa * c == cc || aa == a && bb == b && cc == c) {
|
||||
flag = true;
|
||||
cout << aa << ' ' << bb << ' ' << cc << endl;
|
||||
}
|
||||
} while (std::next_permutation(f, f + 9));
|
||||
if (!flag) {
|
||||
cout << "No!!!" << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user