摘要: 求奇数的乘积 思路:输入数据,判断奇数偶数,然后计算奇数乘积。 代码: #include<iostream> using namespace std; int main() { int n; int num, sum; while (cin >> n) { sum = 1; for (int i = 阅读全文
posted @ 2020-02-01 21:52 PCDL&TIPO 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 第几天? 思路:构建一个闰年和非闰年的二维数组模型:int a[2][13] = { { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 阅读全文
posted @ 2020-02-01 21:37 PCDL&TIPO 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 成绩转换 思路:提前设好数组char a[] = "EEEEEEDCBAA";计算成绩%10,看看是什么成绩 代码: #include<iostream> using namespace std; int main() { char a[] = "EEEEEEDCBAA"; int num; whi 阅读全文
posted @ 2020-02-01 21:30 PCDL&TIPO 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 求绝对值 思路:利用fabs函数计算绝对值,最后输出。 代码: #include<iostream> #include<math.h> using namespace std; int main() { double num; while (cin>>num) { printf("%0.2lf\n" 阅读全文
posted @ 2020-02-01 21:25 PCDL&TIPO 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 计算球体积 思路:输入数据,利用公式计算体积。 注:PI的值以及小数位数 代码: #include<iostream> #define PI 3.1415927 using namespace std; int main() { double r; while (cin >> r) { printf 阅读全文
posted @ 2020-02-01 21:21 PCDL&TIPO 阅读(122) 评论(0) 推荐(0) 编辑
摘要: ASCII码排序 思路:利用ascll表比较大小 代码: #include<iostream> using namespace std; int main() { char a, b, c, t; while (cin >> a >> b >> c) { if (a > c) { t = a; a 阅读全文
posted @ 2020-02-01 21:15 PCDL&TIPO 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 计算两点间的距离 思路:录入数据后,利用两点间公式计算答案 代码: #include<iostream> #include<math.h> using namespace std; int main() { double x1, y1, x2, y2; while (cin >> x1 >> y1 阅读全文
posted @ 2020-02-01 21:03 PCDL&TIPO 阅读(128) 评论(0) 推荐(0) 编辑
摘要: An easy problem 规律:当a >= 'a'&&a <= 'z' 时,sum = -(a - 'a') - 1; 当a >= 'A'&&a <= 'Z'时,sum = a - 'A' + 1; 代码: #include<iostream> using namespace std; int 阅读全文
posted @ 2020-02-01 20:59 PCDL&TIPO 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 1000: 英文题目: 中文题解: 题解: #include<iostream> using namespace std; int main() { int a, b; int num = 0; while (cin >> a >> b) { num = a + b; cout << num << 阅读全文
posted @ 2020-01-25 17:26 PCDL&TIPO 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 英文题目 中文版题目 题目分析: 题目很长,同时也很复杂,如果按照题目的方式进行处理,十分繁琐,并且细节也十分的多,但是,换一种思路思考,带宽不发生改变,总的下载量也不发生改变,所以,不管优先下载哪个,总的时间不会发生改变,所以,我们可以计算出总的下载量,然后除以带宽,即可求出答案。 代码: #in 阅读全文
posted @ 2020-01-24 17:54 PCDL&TIPO 阅读(230) 评论(0) 推荐(0) 编辑