2009年3月7日 星期六

Homework 3

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".

沒有留言:

張貼留言