- 博客(12)
- 收藏
- 关注
原创 试题 基础练习 时间转换
#include<iostream>using namespace std;int main() { int H; int M; int S; H = M = S = 0; int t; cin >> t; while (t >= 60) {//=号要有,处理60,3600等边界情况 M += 1; t -= 60; if (M ==6...
2020-03-23 09:32:02 340
原创 试题 基础练习 闰年判断
#include<iostream>using namespace std;int main() { int year; cin >> year; if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) cout << "yes" << endl; el...
2020-03-22 10:52:44 161
原创 试题 基础练习 数列排序
#include<iostream>#include<algorithm>using namespace std;int a[201];int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a,a+n); for (int...
2020-03-22 10:47:02 326
原创 试题 入门训练 A+B问题
#include<iostream>using namespace std;int main() { int a, b; cin >> a >> b; cout << a + b << endl; return 0;}
2020-03-22 10:38:37 107
原创 试题 入门训练 序列求和
#include<iostream>using namespace std;typedef long long ll;int main() { ll n; cin >> n; cout << (1 + n) * n/ 2 << endl;}
2020-03-22 10:36:23 112
原创 给定正整数 n,请问在整数 1 至 n 中有多少个数位递增的数
问题描述 一个正整数如果任何一个数位不大于右边相邻的数位,则称为一个数位递增的数,例如1135是一个数位递增的数,而1024不是一个数位递增的数。 给定正整数 n,请问在整数 1 至 n 中有多少个数位递增的数?输入格式 输入的第一行包含一个整数 n。输出格式 输出一行包含一个整数,表示答案。样例输入30样例输出26评测用例规模与约定 对于 40% 的评测用例,1...
2020-03-15 15:17:40 1071
原创 1至2019中,有多少个数的数位中包含数字9
问题描述 在1至2019中,有多少个数的数位中包含数字9? 注意,有的数中的数位中包含多个9,这个数只算一次。例如,1999这个数包含数字9,在计算只是算一个数。答案提交 这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。#include<iostream>using namespace st...
2020-03-15 14:45:22 3666 2
原创 试题 基础练习 查找整数
#includeusing namespace std;int main(){int n;int a;int i = 1;cin >> n;int arr[1001];for (int i = 1; i <= n; i++){cin >> arr[i];}cin >> a;for (;i <= n; i++){if (...
2020-03-12 17:56:33 104
原创 试题 算法训练 最大最小公倍数
#includeusing namespace std;int main() {int n;cin >> n;for (int i =17; i <= 1000; i++){if (i % 11 == 0 && i % 17 == 0)cout << i << endl;}}
2020-03-08 18:24:32 178
原创 试题 算法提高 字符串顺序比较
#includeusing namespace std;int main(){string s1;string s2;cin >> s1;cin >> s2;int len = s1.length();for (int i = 0; i < len; i++){if (s1[i] == s2[i])continue;if (s1[i] <...
2020-03-06 22:40:23 316
原创 算法提高 圆的周长与面积
#include#includeusing namespace std;const float pi = 3.14;int main(){float r;cin >> r;float A;float C;cout << 2 * pi * r<<endl;cout << pi * pow(r, 2);}
2020-03-06 22:32:11 272
原创 试题 算法训练 天数计算
#includeusing namespace std;int main(){int year;int month;int day;int month2 = 28;cin >> year;cin >> month;cin >> day;if (year % 4 == 0 && year % 100 != 0 || year ...
2020-03-06 22:20:55 299
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人