五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

CF 271A - Beautiful Year

2023-07-22 10:11 作者:您是打尖兒還是住店呢  | 我要投稿

It seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with only distinct digits.


Now you are suggested to solve the following problem: given a year number, find the minimum year number which is strictly larger than the given one and has only distinct digits.


Input

The single line contains integer y (1000?≤?y?≤?9000) — the year number.


Output

Print a single integer — the minimum year number that is strictly larger than y and all it's digits are distinct. It is guaranteed that the answer exists.

---------------------------------------------------------------

2013年仿佛就在昨天。 你知道一個(gè)奇怪的事實(shí)嗎? 2013 年是 1987 年之后的第一年,只有不同的數(shù)字。


現(xiàn)在建議您解決以下問題:給定一個(gè)年份數(shù)字,找到嚴(yán)格大于給定年份且只有不同數(shù)字的最小年份數(shù)字。


輸入

單行包含整數(shù) y (1000?≤?y?≤?9000) — 年份數(shù)。


輸出

打印一個(gè)整數(shù)——嚴(yán)格大于 y 的最小年份數(shù),并且它的所有數(shù)字都是不同的。 保證答案存在。

--------------------------------------------

while循環(huán)+函數(shù)判斷即可;

下面是代碼:


CF 271A - Beautiful Year的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
鹤庆县| 蒙自县| 山东省| 南京市| 民权县| 佛坪县| 鄂托克前旗| 孝义市| 新干县| 紫金县| 琼中| 准格尔旗| 永安市| 淮滨县| 大竹县| 蒲城县| 吉木乃县| 顺平县| 无为县| 济南市| 石屏县| 息烽县| 安龙县| 江安县| 郁南县| 沈丘县| 平度市| 无为县| 义马市| 衢州市| 长治市| 清水河县| 化隆| 峨边| 贵州省| 台江县| 湖北省| 嘉荫县| 卓尼县| 湘阴县| 通榆县|