牛客305146746号
牛客305146746号
全部文章
题解
归档
标签
去牛客网
登录
/
注册
牛客305146746号的博客
全部文章
/ 题解
(共48篇)
题解 | #高精度整数加法#
注意:因为可能是个非常大的数,所以不能用一个long之类的数字相加这种方法。所以需要数组输出 #include <stdio.h> int main() { char str1[10000] = {0}; char str2[10000] = {0}; scan...
C
2022-06-18
0
188
题解 | #挑7#
#include <stdio.h> int main() { int num = 0; int count = 0; scanf("%d", &num); if(num >= 1 && num <= 30000) ...
C
2022-06-18
4
255
题解 | #公共子串计算#
#include <stdio.h> int main() { char str1[150] = {0}; char str2[150] = {0}; gets(str1); gets(str2); int len1 = strlen(...
C
2022-06-17
0
230
题解 | #计算字符串的编辑距离#
#include <stdio.h> static int min(int a, int b, int c) { a = (a < b)?a:b; a = (a < c)?a:c; return a; } static void ParseStr(...
C
2022-06-17
0
291
题解 | #四则运算#
#include <stdio.h> static int i = 0; static int compute(char *str) { if(!str) { return -1; } int stack[1000] = {0}; ...
C
2022-06-15
0
225
题解 | #从单向链表中删除指定值的节点#
#include <stdio.h> typedef struct node { int data; struct node *next; }link_node; /* 打印链表 */ static void print_link(link_node *head) {...
C
2022-06-15
0
230
题解 | #名字的漂亮度#
思路: 因为仅输入小写字母,所以没有进行不区分大小写的判断 首先判断相同字母的个数,个数最多的*26,然后依次往下减少 #include <stdio.h> #include <string.h> #include <stdlib.h> int cmp(co...
C
2022-06-15
0
222
题解 | #迷宫问题#
思路: 确定当前坐标点(x,y)后,接下来的路径为: 向左(x+1,y) 向右(x-1,y) 向上(x,y+1) 向下(x,y-1) 遍历所有的可行路径 当到达终点后,判断最短的路径并记录下来,输出即可 #include <stdio.h> #include <string.h...
C
2022-06-15
1
442
题解 | #称砝码#
思路: 计算砝码的总重量max,剩余表示的重量不会大于max 申请max+1的空间,判断剩余的重量是否有表示不到的,需要-- #include <stdio.h> int main() { int n = 0; int max = 0; //表示最大重量 ...
C
2022-06-14
7
411
题解 | #求小球落地5次后所经历的路程和第5次反弹的高度#
#include <stdio.h> int main() { double height = 0.0; double temp = 0.0; double ret = 0.0; int num = 0; scanf("%d", &num...
C
2022-06-12
0
220
首页
上一页
1
2
3
4
5
下一页
末页