thousand to ten thousand sort


Submit solution

Points: 10 (partial)
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem types
Allowed languages
Java 19, Java 8

題目說明

輸入一四位數,排序(由小到大)後先輸出,之後再輸入一整數(大於等於0,小於10),並輸出排序後的五位數(由小到大)

輸入限制: 第一整數(大於999,小於10000),第二整數(大於等於0,小於10)

輸入

兩整數(照上輸入限制輸入)

輸出

排序後的四位數與排序後的五位數

sample input1

4321 6

sample output1

1234 //4、3、2、1 做排序,並由小到大輸出
12346 //1、2、3、4、6 做排序,並由小到大輸出

sample input2

1001 0

sample output2

0011 
00011

Comments

There are no comments at the moment.