Input
多组测试数据,每组输入一个正整数N(1≤N≤100)和N个整数,用空格分隔。
Output
将这N个数中的偶数按从大到小的顺序输出
Sample Input
10 8 4 14 2 11 30 40 500 17 100 8 80 200 99 -12 34 55 88 11
Sample Output
500 100 40 30 14 8 4 2 200 88 80 34 -12
Source
mgc1030
插入一个数到数列中
Time Limit:1000MS Memory Limit:65536K
Total Submit:1570 Accepted:917
Description
已有一个排序好的数列:0 10 20 30 40 50 60 70 80,输入一个任意整数m,按序插入到正确位置,输出插入m后的数列。
Input
多组测试数据,每组输入一个整数m
Output
输出插入m后的数列
Sample Input
35 -5 90
Sample Output
0 10 20 30 35 40 50 60 70 80 -5 0 10 20 30 40 50 60 70 80 0 10 20 30 40 50 60 70 80 90
Source
谭jc-p153-4
查找某一个数
Time Limit:1000MS Memory Limit:65536K
Total Submit:1055 Accepted:516
Description
输入一个从小到大排列的有序数列(长度小于100),在此数列中查找某一个数x,若找到,输出相应下标,否则,输出”Not Found\
Input
多组测试数据,先输入要查找的数x和n, 再输入n个有序数。
Output
输出x所在位置下标或\
Sample Input
2 8 -2 2 3 8 9 20 25 67 5 7 -2 2 3 8 9 20 25
Sample Output
1
Not Found
Source
jc-P123-3
颠倒字符串
Time Limit:1000MS Memory Limit:65536K
Total Submit:1643 Accepted:983
Description
输入一个以回车结束的字符串(少于80个字符),将字符串的内容颠倒过来再输出
Input
多组测试数据,每组输入一个以回车结束的字符串(少于80个字符)。
Output
将这个字符串颠倒过来输出
Sample Input
ABC XYZ My god
Sample Output
ZYX CBA
dog yM
Source
mgc1031
重组字符串
Time Limit:1000MS Memory Limit:65536K
Total Submit:683 Accepted:521
Description
输入一个以回车结束的字符串,将字符串中的字符按ASCII码从小到大顺序重组后输出。
Input
输入一个以回车结束的字符串(少于80个字符)。
Output
将字符串中的字符按ASCII码从小到大顺序重组后输出
Sample Input
Student
Sample Output
Sdenttu
Source
mgc1032
删除操作
Time Limit:1000MS Memory Limit:65536K
Total Submit:433 Accepted:325
Description
将一行字符串中的指定字符串删除.
Input
输入一行以回车结束的字符串str1(少于80个字符)和一个字符串str2(少于80个字符)。
Output
输出完成删除字符串str2后的字符串。如果待删除的str2不在str1中,则不进行删除操作,输出原来的str1。
Sample Input
Hello World! or
Sample Output
Hello Wld!
Source
mgc1035
更改大小写
Time Limit:1000MS Memory Limit:65536K
Total Submit:1160 Accepted:936
Description