上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 计算两点间的距离Problem Description输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。Input输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。Output对于每组输入数据,输出一行,结果保留两位小数。Sample ... 阅读全文
posted @ 2015-03-29 19:23 Eric_keke 阅读(284) 评论(0) 推荐(0) 编辑
摘要: A + B ProblemProblem Description CalculateA + B.InputEach line will contain two integersAandB. Process to end of file.OutputFor each case, outputA + B... 阅读全文
posted @ 2015-03-29 18:53 Eric_keke 阅读(167) 评论(0) 推荐(1) 编辑
摘要: Problem Description输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。Input输入数据有多组,每组占一行,有三个字符组成,之间无空格。Output对于每组输入数据,输出一行,字符中间用一个空格分开。Sample InputqweasdzxcSample Outp... 阅读全文
posted @ 2015-03-29 17:05 Eric_keke 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 定义符号常量 当我们不止一次用到某个符号常量时,常选择对符号变量进行定义,这样就能当成一般常量来用. 1 #include 2 #include 3 #define PI 3.1415926 4 int main() 5 { 6 double r,ar... 阅读全文
posted @ 2015-03-28 14:19 Eric_keke 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 先举一个简单点的例子#include#includeint main(){ float a,b; char c; printf("input expression:a+(-,*,/)b\n"); scanf("%f%c%f",&a,&c,&b); swi... 阅读全文
posted @ 2015-03-27 13:00 Eric_keke 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 给出一个数m,判断其是否为素数 我这是用一个比较笨蛋的方法,以后会继续更新好的方法的!#include#includeint main(){ int a,i; scanf("%d",&a); for(i=2;i<=a;i++) { if(a%i==0)//将2到... 阅读全文
posted @ 2015-03-25 22:32 Eric_keke 阅读(159) 评论(0) 推荐(0) 编辑
摘要: π/4=1-1/3+1/5-1/7…+1/(4n-3)-1/(4n-1)首先,右面式子一正一负,可用pow(x,y)函数; 分母为奇数,可用2*i-1来表示,可用for语句来决定精度! 代码如下:#include#include//调用数学函数int main(){ ... 阅读全文
posted @ 2015-03-25 21:27 Eric_keke 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge). In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + … + n.**Input T... 阅读全文
posted @ 2015-03-24 16:11 Eric_keke 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 正三角形的外接圆面积 时间限制:1000ms | 内存限制:65535KB难度:0描述给你正三角形的边长,pi=3.1415926 ,求正三角形的外接圆面积。输入只有一组测试数据 第一行输入一个整数n(1#include#define PI 3.1415926//定义符号常量PIint main()... 阅读全文
posted @ 2015-03-23 18:56 Eric_keke 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 如果运算符两边的数据类型不统一,则较低类型的需要转化成较高类型,再参加运算。 运算符的高低如下:char,short→int→unsigned→long→double←float 1 #include 2 #include 3 int main() 4 { 5 float f=5.97... 阅读全文
posted @ 2015-03-22 21:14 Eric_keke 阅读(334) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页