内容发布更新时间 : 2025/5/26 9:26:30星期一 下面是文章的全部内容请认真阅读。
Sample Output 2 3 4 8 9 10 14 15 Answer
#include
16、A+B ProblemT
Description
计算a+b,0<=a,b<1000。 Input
输入有多对整数a和b组成,每对a和b占一行,a,b用空格分开。 Output
每行输出一个a+b的值,顺序与输入对应。 Sample Input 1 2 10 20
Sample Output 3 30
Answer
#include
17、A+B Problem (II) : Input/Output Pratice
Description
计算a+b,0<=a,b<1000。 Input
输入的第一行是一个整数N,后面有N对整数a和b,每对a和b占一行,a,b用空格分开。 Output
每行输出一个a+b的和,顺序与输入对应。 Sample Input 2 1 2 10 20
Sample Output 3 30
Answer
#include
18、成绩的等级
Description
把百分制的考试成绩转换成五级制的成绩: 90~100:Excellent 80~89:Good 70~79:Average 60~69:Pass 0~59:Failing
不在0~100之间的输入是非法数据,输出“Error”。 Input
输入多行,每行一个整数。 Output
输入所对应的成绩等级。 Sample Input -1 81 92 35 68 72 100
Sample Output Error Good Excellent Failing Pass Average Excellent Answer
#include
int score; while(scanf(\ { if (score<0||score>100) printf(\ else {
switch (score/10) { case 0: case 1: case 2: case 3: case 4: case 5:printf(\ case 6:printf(\ case 7:printf(\ case 8:printf(\ case 9: case 10:printf(\