牛客7777779号
牛客7777779号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客7777779号的博客
全部文章
(共86篇)
题解 | #火星A+B#
一开始是用string数组做,但是只能做一位加法,多位就不好判断字符串,所以改用数组存储数字,再计算。分别用a b数组存储输入的字符串中的数字用sum数组存储每一位的加和,注意,最好是逆序存储和,这样如果有进位可以存储在sum[count+1],不会出现下溢对sum数组处理进位(知道十进制进位的方法...
2023-02-21
0
226
题解 | #简单密码#
A的ASCII码为65, V的ASCII码为86 #include <cstring> #include <iostream> using namespace std; int main() { string str; while (getline(cin,...
2023-02-20
0
137
题解 | #加减乘除#
#include <iostream> using namespace std; int main() { int a, b; char op; while (cin >> a >> op) { // 注意 while 处理多个 case...
2023-02-20
0
216
题解 | #字符串内排序#
#include <algorithm> #include <iostream> using namespace std; int main() { string str; while (cin >> str) { // 注意 while 处理多...
2023-02-19
0
125
题解 | #skew数#
!!审题要清楚,和二进制转换不同,不像二进制从0开始,我看半天没算出来,最后发现是审题问题。大数运算,要转成字符串,用字符数组运算。 #include <iostream> #include <string> #include<math.h> using name...
2023-02-13
0
165
题解 | #学分绩点#
#include <iomanip> #include <iostream> using namespace std; int main() { int n;//总课程数 float credit = 0.0, gpa = 0.0,GPA = 0.0;//分...
2023-02-13
0
214
题解 | #手机键盘#
#include <iostream> using namespace std; #include <string> char A[3][3][4] = {{{'a','b','c'},{'d','e','f'},{' ',' ',' '}}, {{'g','h','i'}...
2023-02-12
0
159
题解 | #位操作练习#
#include <iostream> using namespace std; //十进制转二进制 void bin(int a[],int m){ for (int i = 15; i >= 0; i--){ //从数组最后一位开始存,正序输出数组就是正确的二进制 ...
2023-02-12
1
211
题解 | #abc#
#include <iostream> using namespace std; int main() { int a, b; for(int i = 1; i < 10; i++){//a的取值 for (int j = 1; j < 10...
2023-02-12
0
139
题解 | #打印极值点下标#
一直数组上溢,本来想说是不是给分配的内存少,超过30个的数组要分开几次存储,结果!只要把数组定义语句放在while里面就行了,写了好久。。 #include <iostream> using namespace std; int main() { int n; ...
2023-02-10
0
193
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页