最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(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)遵守國家法律
古丈县| 太仆寺旗| 玛沁县| 潼关县| 法库县| 循化| 高唐县| 周口市| 佛冈县| 探索| 马尔康县| 绵竹市| 阜南县| 富宁县| 溆浦县| 玛多县| 东安县| 惠安县| 沈丘县| 瓦房店市| 陇西县| 远安县| 准格尔旗| 永昌县| 清水河县| 昌宁县| 竹北市| 河源市| 三原县| 咸宁市| 堆龙德庆县| 双流县| 和顺县| 庆云县| 宁德市| 莎车县| 抚松县| 普宁市| 陇西县| 清水县| 定襄县|