互联网公司面试题之八
问题一:读入两个小于100的正整数A和B,计算A+B。需要注意的是:A和B的每一位数字由对应的英文单词给出。
例如:
one + two =
three four + five six =
zero seven + eight nine =
zero + zero =
当A和B同时为0时输入结束,相应的结果不要输出。
答:实现代码如下:
运行结果:
问题二:You are given an unsorted array of integer numbers. Your task is to sort this array and kill possible duplicated elements occurring in it.
Input:For each case, the first line of the input contains an integer number N representing the quantity of numbers in this array(1≤N≤1000). Next N lines contain N integer numbers(one number per each line) of the original array.
Output:For each case ,outtput file should contain at most N numbers sorted in ascending order. Every number in the output file should occur only once.
答:实现代码如下:
运行结果: