- 博客(18)
- 收藏
- 关注
原创 2039 三角形
Problem Description给定三条边,请你判断一下能不能组成一个三角形。Input输入数据第一行包含一个数M,接下有M行,每行一个实例,包含三个正数A,B,C。其中A,B,C <1000;Output对于每个测试实例,如果三条边长A,B,C能组成三角形的话,输出YES,否则NO。Sample Input21 2 32 2 2Sample OutputNOY...
2020-02-10 16:34:17 215
原创 2007 平方和与立方和
Problem Description给定一段连续的整数,求出他们中所有偶数的平方和以及所有奇数的立方和。Input输入数据包含多组测试实例,每组测试实例包含一行,由两个整数m和n组成。Output对于每组输入数据,输出一行,应包括两个整数x和y,分别表示该段连续的整数中所有偶数的平方和以及所有奇数的立方和。你可以认为32位整数足以保存结果。Sample Input1 32 5...
2020-02-09 16:20:07 242
原创 2009 求数列的和
Problem Description数列的定义如下:数列的第一项为n,以后各项为前一项的平方根,求数列的前m项的和。Input输入数据有多组,每组占一行,由两个整数n(n<10000)和m(m<1000)组成,n和m的含义如前所述。Output对于每组输入数据,输出该数列的和,每个测试实例占一行,要求精度保留2位小数。Sample Input81 42 2Samp...
2020-02-06 22:20:49 127
原创 2008 数值统计
Problem Description统计给定的n个数中,负数、零和正数的个数。Input输入数据有多组,每组占一行,每行的第一个数是整数n(n<100),表示需要统计的数值的个数,然后是n个实数;如果n=0,则表示输入结束,该行不做处理。Output对于每组输入数据,输出一行a,b和c,分别表示给定的数据中负数、零和正数的个数。Sample Input6 0 1 2 3 -1...
2020-02-06 22:13:56 91
原创 2006 求奇数的乘积
Problem Description给你n个整数,求他们中所有奇数的乘积。Input输入数据包含多个测试实例,每个测试实例占一行,每行的第一个数为n,表示本组数据一共有n个,接着是n个整数,你可以假设每组数据必定至少存在一个奇数。Output输出每组数中的所有奇数的乘积,对于测试实例,输出一行。Sample Input3 1 2 34 2 3 4 5Sample Output...
2020-02-03 13:50:05 166
原创 2005 第几天?
Problem Description给定一个日期,输出这个日期是该年的第几天。Input输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的。Output对于每组输入数据,输出一行,表示该日期是该年的第几天。Sample Input1985/1/202006/3/12Sample Outpu...
2020-02-03 13:36:20 97
原创 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 277
原创 2003 求绝对值
Problem Description求实数的绝对值。Input输入数据有多组,每组占一行,每行包含一个实数。Output对于每组输入数据,输出它的绝对值,要求每组数据输出一行,结果保留两位小数。Sample Input123-234.00Sample Output123.00234.00解题过程#include <stdio.h>int main(){...
2020-02-03 13:13:01 143
原创 2002 计算球体积
Problem Description根据输入的半径值,计算球的体积。Input输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。Output输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。Sample Input11.5Sample Output4.18914.137Hint#define PI 3.1415927解题过程#inclu...
2020-01-31 19:08:47 255
原创 2001 计算两点间的距离
Problem Description输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。Input输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。Output对于每组输入数据,输出一行,结果保留两位小数。Sample Input0 0 0 10 1 1 0Sample Output1.001.41解题过程#...
2020-01-31 16:59:35 169 1
原创 2000 ASCII码排序
Problem Description输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。Input输入数据有多组,每组占一行,有三个字符组成,之间无空格。Output对于每组输入数据,输出一行,字符中间用一个空格分开。Sample InputqweasdzxcSample Outpute q wa d sc x z解题过程#include <s...
2020-01-30 19:35:53 209 4
原创 第一阶段第一部分总结
通过截图总结哪怕一些简单的计算题,也有值得思考的地方,处处都有值得学习的知识点,做题不仅仅是需要严密的思路,还需要把握细节,明白关键点在哪?加油吧!少年!继续努力中······...
2020-01-29 19:55:16 110
原创 1096 A+B for Input-Output Practice (VIII)
ProblemDescription Your task is to calculate the sum of some integers.InputInput 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 410 1
原创 1095 A+B for Input-Output Practice (VII)
ProblemDescription Your task is to Calculate a + b.InputThe input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.OutputFor each pair of...
2020-01-29 17:46:30 366
原创 1094 A+B for Input-Output Practice (VI)
ProblemDescription Your task is to calculate the sum of some integers.InputInput 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 157
原创 1093 A+B for Input-Output Practice (V)
ProblemDescription Your task is to calculate the sum of some integers.InputInput 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 290
原创 1092 A+B for Input-Output Practice (IV)
Problem DescriptionYour task is to Calculate the sum of some integers.InputInput 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 241
原创 Calculate A + B.
InputEach line will contain two integers A and B. Process to end of file.OutputFor each case, output A + B in one line.Sample Input1 1Sample Output2解题过程#include <stdio.h>int main(){i...
2020-01-22 20:56:33 3271 3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人