- 博客(18)
- 收藏
- 关注
原创 2039 三角形
Problem Description 给定三条边,请你判断一下能不能组成一个三角形。 Input 输入数据第一行包含一个数M,接下有M行,每行一个实例,包含三个正数A,B,C。其中A,B,C <1000; Output 对于每个测试实例,如果三条边长A,B,C能组成三角形的话,输出YES,否则NO。 Sample Input 2 1 2 3 2 2 2 Sample Output NO Y...
2020-02-10 16:34:17
306
原创 2007 平方和与立方和
Problem Description 给定一段连续的整数,求出他们中所有偶数的平方和以及所有奇数的立方和。 Input 输入数据包含多组测试实例,每组测试实例包含一行,由两个整数m和n组成。 Output 对于每组输入数据,输出一行,应包括两个整数x和y,分别表示该段连续的整数中所有偶数的平方和以及所有奇数的立方和。 你可以认为32位整数足以保存结果。 Sample Input 1 3 2 5 ...
2020-02-09 16:20:07
316
原创 2009 求数列的和
Problem Description 数列的定义如下: 数列的第一项为n,以后各项为前一项的平方根,求数列的前m项的和。 Input 输入数据有多组,每组占一行,由两个整数n(n<10000)和m(m<1000)组成,n和m的含义如前所述。 Output 对于每组输入数据,输出该数列的和,每个测试实例占一行,要求精度保留2位小数。 Sample Input 81 4 2 2 Samp...
2020-02-06 22:20:49
213
原创 2008 数值统计
Problem Description 统计给定的n个数中,负数、零和正数的个数。 Input 输入数据有多组,每组占一行,每行的第一个数是整数n(n<100),表示需要统计的数值的个数,然后是n个实数;如果n=0,则表示输入结束,该行不做处理。 Output 对于每组输入数据,输出一行a,b和c,分别表示给定的数据中负数、零和正数的个数。 Sample Input 6 0 1 2 3 -1...
2020-02-06 22:13:56
170
原创 2006 求奇数的乘积
Problem Description 给你n个整数,求他们中所有奇数的乘积。 Input 输入数据包含多个测试实例,每个测试实例占一行,每行的第一个数为n,表示本组数据一共有n个,接着是n个整数,你可以假设每组数据必定至少存在一个奇数。 Output 输出每组数中的所有奇数的乘积,对于测试实例,输出一行。 Sample Input 3 1 2 3 4 2 3 4 5 Sample Output ...
2020-02-03 13:50:05
244
原创 2005 第几天?
Problem Description 给定一个日期,输出这个日期是该年的第几天。 Input 输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的。 Output 对于每组输入数据,输出一行,表示该日期是该年的第几天。 Sample Input 1985/1/20 2006/3/12 Sample Outpu...
2020-02-03 13:36:20
163
原创 2004 成绩转换
Problem Description 输入一个百分制的成绩t,将其转换成对应的等级,具体转换规则如下: 90~100为A; 80~89为B; 70~79为C; 60~69为D; 0~59为E; Input 输入数据有多组,每组占一行,由一个整数组成。 Output 对于每组输入数据,输出一行。如果输入数据不在0~100范围内,请输出一行:“Score is error!”。 Sample Inp...
2020-02-03 13:24:59
345
原创 2003 求绝对值
Problem Description 求实数的绝对值。 Input 输入数据有多组,每组占一行,每行包含一个实数。 Output 对于每组输入数据,输出它的绝对值,要求每组数据输出一行,结果保留两位小数。 Sample Input 123 -234.00 Sample Output 123.00 234.00 解题过程 #include <stdio.h> int main() { ...
2020-02-03 13:13:01
214
原创 2002 计算球体积
Problem Description 根据输入的半径值,计算球的体积。 Input 输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。 Output 输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。 Sample Input 1 1.5 Sample Output 4.189 14.137 Hint #define PI 3.1415927 解题过程 #inclu...
2020-01-31 19:08:47
342
原创 2001 计算两点间的距离
Problem Description 输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。 Input 输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。 Output 对于每组输入数据,输出一行,结果保留两位小数。 Sample Input 0 0 0 1 0 1 1 0 Sample Output 1.00 1.41 解题过程 #...
2020-01-31 16:59:35
238
1
原创 2000 ASCII码排序
Problem Description 输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。 Input 输入数据有多组,每组占一行,有三个字符组成,之间无空格。 Output 对于每组输入数据,输出一行,字符中间用一个空格分开。 Sample Input qwe asd zxc Sample Output e q w a d s c x z 解题过程 #include <s...
2020-01-30 19:35:53
316
4
原创 第一阶段第一部分总结
通过截图 总结 哪怕一些简单的计算题,也有值得思考的地方,处处都有值得学习的知识点,做题不仅仅是需要严密的思路,还需要把握细节,明白关键点在哪?加油吧!少年!继续努力中······ ...
2020-01-29 19:55:16
167
原创 1096 A+B for Input-Output Practice (VIII)
Problem Description Your task is to calculate the sum of some integers. Input Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M inte...
2020-01-29 19:38:47
505
1
原创 1095 A+B for Input-Output Practice (VII)
Problem Description Your task is to Calculate a + b. Input The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line. Output For each pair of...
2020-01-29 17:46:30
451
原创 1094 A+B for Input-Output Practice (VI)
Problem Description Your task is to calculate the sum of some integers. Input Input contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow ...
2020-01-29 17:26:25
214
原创 1093 A+B for Input-Output Practice (V)
Problem Description Your task is to calculate the sum of some integers. Input Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M inte...
2020-01-29 17:17:44
367
原创 1092 A+B for Input-Output Practice (IV)
Problem Description Your task is to Calculate the sum of some integers. Input Input contains multiple test cases. Each test case contains a integer N, and then N integers follow in the same line. A te...
2020-01-28 21:22:33
323
原创 Calculate A + B.
Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in one line. Sample Input 1 1 Sample Output 2 解题过程 #include <stdio.h> int main() { i...
2020-01-22 20:56:33
3468
3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅