Skip to content

Commit 917a84a

Browse files
committed
Beautiful Year
1 parent 11a03ae commit 917a84a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

271A.cpp

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

0 commit comments

Comments
 (0)