![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
杭电ACM题库
北枳寻楠辞
这个作者很懒,什么都没留下…
展开
-
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 · 234 阅读 · 0 评论 -
2007 平方和与立方和
Problem Description给定一段连续的整数,求出他们中所有偶数的平方和以及所有奇数的立方和。Input输入数据包含多组测试实例,每组测试实例包含一行,由两个整数m和n组成。Output对于每组输入数据,输出一行,应包括两个整数x和y,分别表示该段连续的整数中所有偶数的平方和以及所有奇数的立方和。你可以认为32位整数足以保存结果。Sample Input1 32 5...原创 2020-02-09 16:20:07 · 250 阅读 · 0 评论 -
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 · 133 阅读 · 0 评论 -
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 · 102 阅读 · 0 评论 -
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 · 173 阅读 · 0 评论 -
2005 第几天?
Problem Description给定一个日期,输出这个日期是该年的第几天。Input输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的。Output对于每组输入数据,输出一行,表示该日期是该年的第几天。Sample Input1985/1/202006/3/12Sample Outpu...原创 2020-02-03 13:36:20 · 109 阅读 · 0 评论 -
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 · 287 阅读 · 0 评论 -
2003 求绝对值
Problem Description求实数的绝对值。Input输入数据有多组,每组占一行,每行包含一个实数。Output对于每组输入数据,输出它的绝对值,要求每组数据输出一行,结果保留两位小数。Sample Input123-234.00Sample Output123.00234.00解题过程#include <stdio.h>int main(){...原创 2020-02-03 13:13:01 · 150 阅读 · 0 评论 -
2002 计算球体积
Problem Description根据输入的半径值,计算球的体积。Input输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。Output输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。Sample Input11.5Sample Output4.18914.137Hint#define PI 3.1415927解题过程#inclu...原创 2020-01-31 19:08:47 · 267 阅读 · 0 评论 -
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 · 172 阅读 · 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 · 221 阅读 · 4 评论 -
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 · 419 阅读 · 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 · 374 阅读 · 0 评论 -
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 · 164 阅读 · 0 评论 -
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 · 297 阅读 · 0 评论 -
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 · 249 阅读 · 0 评论