牛客305146746号
牛客305146746号
全部文章
分类
题解(48)
归档
标签
去牛客网
登录
/
注册
牛客305146746号的博客
全部文章
(共57篇)
题解 | #挑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
247
题解 | #公共子串计算#
#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
227
题解 | #计算字符串的编辑距离#
#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
283
题解 | #四则运算#
#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
220
题解 | #从单向链表中删除指定值的节点#
#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
228
题解 | #名字的漂亮度#
思路: 因为仅输入小写字母,所以没有进行不区分大小写的判断 首先判断相同字母的个数,个数最多的*26,然后依次往下减少 #include <stdio.h> #include <string.h> #include <stdlib.h> int cmp(co...
C
2022-06-15
0
216
题解 | #迷宫问题#
思路: 确定当前坐标点(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
436
题解 | #称砝码#
思路: 计算砝码的总重量max,剩余表示的重量不会大于max 申请max+1的空间,判断剩余的重量是否有表示不到的,需要-- #include <stdio.h> int main() { int n = 0; int max = 0; //表示最大重量 ...
C
2022-06-14
7
405
题解 | #求小球落地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
218
题解 | #字符串加密#
#include <stdio.h> /* 函数功能:查询pass数组中是否存在target字符。 存在返回1,不存在返回0 */ static int check_str(char *pass, int lenpass, char target) { for(int i = ...
C
2022-06-12
0
200
首页
上一页
1
2
3
4
5
6
下一页
末页