摘要: #include<iostream>using namespace std;int main(void) { int m,n,x,y=0,i; while(cin>>m>>n) { for(i=m; i<=n; i++) { if(i%2==0) x+=i*i; else y=y+i*i*i; } 阅读全文
posted @ 2020-02-19 11:28 heroin1 阅读(141) 评论(0) 推荐(0)
摘要: #include<iostream>using namespace std;int main(void) { int x,y,z,i,day=0; char m,n; int flag=0; int a[12]= {31,28,31,30,31,30,31,31,30,31,30,31}; int 阅读全文
posted @ 2020-02-19 11:14 heroin1 阅读(82) 评论(0) 推荐(0)
摘要: #include <stdio.h>int main(){ int t; while(scanf("%d",&t)!=EOF) { if(t>=0&&t<=100) { t=t/10; switch(t) { case 10: case 9: printf("A\n"); break; case 8 阅读全文
posted @ 2020-02-19 10:10 heroin1 阅读(186) 评论(0) 推荐(0)
摘要: #include <iostream>#include<iomanip>using namespace std;int main(void){ double a; while(cin>>a) { if(a<0) a=-a; cout<<fixed<<setprecision(2); cout<<a< 阅读全文
posted @ 2020-02-16 13:56 heroin1 阅读(100) 评论(0) 推荐(0)
摘要: #include <iostream>#define PI 3.1415927#include<iomanip>using namespace std;class ball{ public: double setV(double R) { double V=4.0/3*PI*R*R*R; retur 阅读全文
posted @ 2020-02-16 13:51 heroin1 阅读(156) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;int main(void){ char a, b, c,d; cin >> a >> b >> c; if (a > b) { d = a; a = b; b = d; } if (a> c) { d = a; a = 阅读全文
posted @ 2020-02-16 13:37 heroin1 阅读(132) 评论(0) 推荐(0)
摘要: 输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。 Input输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。Output对于每组输入数据,输出一行,结果保留两位小数。Sample Input 0 0 0 1 0 1 1 0 Samp 阅读全文
posted @ 2020-01-31 11:37 heroin1 阅读(542) 评论(0) 推荐(0)
摘要: 计算函数 SUM(n) = 1 + 2 + 3 + ... + n的值. Input 输入包含一系列的整数n,占一行. Output 对于每一组输入,输出一行,即SUM(n)的值,后跟一行空白行. 假定所有结果都在32位有符号整型范围内. Sample Input 1 100 Sample Outp 阅读全文
posted @ 2020-01-31 11:09 heroin1 阅读(233) 评论(0) 推荐(0)
摘要: 你的任务是计算多个数的和。 Input第一行输入一个整数 N。接下来的 N 行,每行都以一个整数 M 开头,接下来的 M 个数位于同一行。 Output对于输入的每组数据,你需要在一行内输出它们的和,且需要注意的是每组输出之间都要有一个空行。 Sample Input 3 4 1 2 3 4 5 1 阅读全文
posted @ 2020-01-31 10:58 heroin1 阅读(195) 评论(0) 推荐(0)
摘要: 你的任务是计算a+b。Input 输入由一系列成对的由空格分割的整数a和b构成,一对输入占用一行。 Output 对于每组输入,要求在一行输出它们的和。并且你要保证每组输出之间有一空行。 Sample Input 1 5 10 20 Sample Output 6 30 #include<iostr 阅读全文
posted @ 2020-01-31 10:35 heroin1 阅读(135) 评论(0) 推荐(0)