牛客7777779号
牛客7777779号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客7777779号的博客
全部文章
(共86篇)
题解 | #成绩排序#
注意!虽然冒泡排序是稳定的算法,但是测试用例不是全都按照学号由小到大的顺序输入的,所以一定要对成绩相同的学生进行学号的排序。 #include <algorithm> #include <iostream> using namespace std; struct studen...
2023-02-24
0
178
题解 | #ZOJ#
#include <cstring> #include <iostream> using namespace std; #define N 100 int main() { char str[N]; while (cin >> str) { // ...
2023-02-24
0
209
题解 | #数组逆置#
不用c++ reverse函数的解法:(常规char数组方法)注意!尾指针指到字符数组最后一位是'\0',并不是有效字符, 此时,尾指针q需要回退一位。 #include <algorithm> #include <iostream> using namespace std...
2023-02-23
0
200
题解 | #数组逆置#
用c++自带的reverse逆转函数 #include <algorithm> #include <iostream> using namespace std; int main() { string str; while (cin >> str)...
2023-02-23
0
156
题解 | #字符串链接#
注意!不要忘记加上字符串结束符'\0' #include <iostream> using namespace std; # define N 1000 void MyStrcat(char dstStr[],char srcStr[]){ char *p = dstStr; ...
2023-02-23
3
225
题解 | #最大公约数#
#include <iostream> using namespace std; int gcd(int a,int b){ //求最大公约数函数 int r; do{ r = a%b; a = b; b = r; ...
2023-02-23
0
156
题解 | #统计同成绩学生人数#
#include <iostream> using namespace std; int main() { int n; while (cin >> n && n != 0) { // 注意 while 处理多个 case double a[...
2023-02-23
0
140
题解 | #统计字符#
定义string变量,想要读入空格,可以用getline函数,参数为(cin,变量) #include <iostream> using namespace std; #include <string> int main() { string str1,str2; ...
2023-02-23
0
187
题解 | #字母统计#
#include <iostream> using namespace std; struct table{ char ch; //字母 int count; //计数 }table[26]; int main() { string str; while ...
2023-02-23
0
174
题解 | #浮点数加法#
将两个浮点数a b,分别分为整数和小数部分 分别存储在四个不同的数组中将a b的 整数部分加和,存在数组SUM中(要保证每一位正确的对齐,需要逆序存储);将a b的 小数部分加和,存在数组sum中(这里注意小数的加和与整数部分不同,在位数不同的情况下,要保证每一位正确的对齐,需要正序存储)先对小数部...
2023-02-21
0
190
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页