Skip to content

Commit a3e2249

Browse files
authored
271A
1 parent 1c43847 commit a3e2249

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Beautiful_Year.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int y;
7+
cin >> y;
8+
while (true)
9+
{
10+
y += 1;
11+
int a = y / 1000;
12+
int b = y / 100 % 10;
13+
int c = y / 10 % 10;
14+
int d = y % 10;
15+
if (a != b && a != c && a != d && b != c && b != d && c != d)
16+
{
17+
break;
18+
}
19+
}
20+
cout << y << endl;
21+
return 0;
22+
}

0 commit comments

Comments
 (0)