牛客题解官
牛客题解官
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客题解官的博客
全部文章
/ 题解
(共587篇)
平均身高
分析: 读入五个浮点数求和平均即可。 题解: #include <bits/stdc++.h> using namespace std; int main() { float a, b, c, d, e; //分别用float读入五门不同的成绩 scanf("%...
2020-06-04
0
572
挂科危险
题目描述KiKi想知道这学期他的学习情况,BoBo老师告诉他这学期挂的科目累计的学分,根据所挂学分,判断KiKi学习情况,10分以上:很危险(Danger++),4 ~ 9分:危险(Danger),0 ~ 3:Good。输入描述:一行,一个整数(0~30),表示KiKi挂的科目累计的学分。输出描述:...
2020-06-04
0
680
HTTP状态码
分析: 可行方案有两种,使用if else嵌套或者使用switch进行判断。 题解1: #include <bits/stdc++.h> using namespace std; int main() { int val = 0; //循环读入每一个http状态码 ...
2020-06-04
0
646
数字三角形
分析: 二重循环的使用,外循环控制行数,内循环控制每行输出的数字,输出逐个数字后加上空格即可。 题解: #include <bits/stdc++.h> using namespace std; int main() { int n; //循环读入n while...
2020-06-04
0
652
十六进制转十进制
分析: 利用printf或者cout可以直接按照十进制输出。 题解: #include <bits/stdc++.h> using namespace std; int main() { int val = 0xABCDEF; //根据题意按照15位宽整数输出即可 ...
2020-06-04
4
1118
大小写转换
分析: 两种思路,查表找出对应的小写字母,或者使用tolower等库函数转换大小写。 题解: #include <bits/stdc++.h> using namespace std; int main() { char ch = 0; //循环多次读入,利用getha...
2020-06-04
10
928
我是大V
分析: 由于输出结果是固定的,可以采用硬编码方式,注意的是中间额空格不能省略。 题解: #include <bits/stdc++.h> using namespace std; int main() { //按照题意进行硬编码输出即可,注意每个v之间的空格即可。 pr...
2020-06-04
3
1026
分而治之
分析: 硬编码方式输出结果即可,这里使用了printf函数输出,cout结果类似。 题解: #include <bits/stdc++.h> using namespace std; int main() { //利用printf挨个进行输出即可 printf("1. ...
2020-06-04
0
643
争夺前五名
分析: 第一种比较直观的方法是使用sort函数排序后选择前五个即可,另外一种是每次挑出最大的数然后置为0即可。 题解: #include <bits/stdc++.h> using namespace std; int main() { int n = 0; scanf...
2020-06-04
7
821
X形图案
分析: X形图案可以拆分成两根斜线,其中i==j时输出星号,或者i==n-i-1时输出星号即可,其他情况皆输出空格。 题解: #include <bits/stdc++.h> using namespace std; int main() { int n; while ...
2020-06-04
39
1882
首页
上一页
44
45
46
47
48
49
50
51
52
53
下一页
末页