0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-30 19:56:28 +00:00

P1008 [NOIP1998 普及组] 三连击

R58784369
This commit is contained in:
Baoshuo Ren 2021-09-30 13:27:48 +08:00 committed by Baoshuo Ren
parent 6cf0a2271b
commit 6c119e64e1
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,17 @@
#include <bits/stdc++.h>
using namespace std;
int a, b, c, f[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
int main() {
do {
a = f[0] * 100 + f[1] * 10 + f[2];
b = f[3] * 100 + f[4] * 10 + f[5];
c = f[6] * 100 + f[7] * 10 + f[8];
if (a * 3 == c && b * 3 == c * 2) {
cout << a << ' ' << b << ' ' << c << endl;
}
} while (next_permutation(f, f + 9));
return 0;
}