MCS 275 homework #1 Due date: 19970905 D. J. Bernstein 19970829 Exercise 1. Write a program that reads some integers and then prints them in ascending order. Use the following method. Find the smallest integer, and swap it into the first position. Find the smallest integer starting at the second position, and swap it into the second position. Continue until the last position. For example, 3 1 4 1 5 changes to 1 3 4 1 5, then 1 1 4 3 5, then 1 1 3 4 5, then 1 1 3 4 5 again, done. You may assume that there are at most 100 integers. Exercise 2. Here is the Josephus problem. There are 7 men standing in a line: 1234567. The third man is brutally executed: 124567. The executioner continues down the line and executes the third man: 12457. He proceeds in this way, returning to the beginning of the line when he reaches the end: 1457, 145, 14, 4. Write a program that reads two integers, m and c, and prints the order of executions when there are m men counted by c. For example, with input 7 3, your program will print 3 6 2 7 5 1 4. With input 12 4, your program will print 4 8 12 5 10 3 11 7 6 9 2 1. You may assume that m and c do not exceed 100.