2009年3月9日 星期一

Homework 3-2-2009

1. Write a program that can reverse the order of an input string. For example, if you input "ab", it will output "ba". If you input "abcdefg", it should return "gfedcba".







2. Write a program that can print names alternatively. The names are in the format of "First Name + Last Name" or "Last Name, First Name". For example, if you input "Walt Savitch", your program will output "Savitch, Walt". If you input "Savitch, Walt", your program will output "Walt Savitch".







沒有留言: