土办法。感觉这题目没说仔细 摘要:解题思路:题目并没有说明m,n 的奇偶性,但根据大家发的题解,好像有默认。。我发一个没默认的土办法。:)注意事项:要想清楚在range里的参数范围到底要不要+1参考代码:m,n = map(int,i…… 题解列表 2025年02月25日 0 点赞 0 评论 546 浏览 评分:0.0
C语言简单解法 摘要:解题思路:使用fgets来读取字符串,用fgets+strcspn()处理换行 符代替gets()可以避免gets()带来的安全风险。注意事项:注意,fgets()读取后会…… 题解列表 2025年02月25日 2 点赞 0 评论 1498 浏览 评分:10.0
利用循环得到n次的数字,然后求和 摘要:解题思路:每次循环把上一个值乘10再加上结尾的2注意事项:跳出循环后还需要再算一次和参考代码:int main(){ int a=2,n;&…… 题解列表 2025年02月25日 1 点赞 0 评论 1017 浏览 评分:0.0
贪心算法解决金银岛 摘要:解题思路:注意事项:参考代码:def bravery(data,w): data.sort(key=lambda x:x[2],reverse=True) &n…… 题解列表 2025年02月26日 0 点赞 0 评论 328 浏览 评分:0.0
题解 1196: 去掉空格 摘要:#include #include void fun(char str[]){ int j; int length = strlen(str); for (int …… 题解列表 2025年02月26日 3 点赞 0 评论 509 浏览 评分:8.7
字符串的输入输出处理 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>#define max 1000int main(){ int n,i=0;…… 题解列表 2025年02月26日 1 点赞 0 评论 973 浏览 评分:10.0
The 3n + 1 problem 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int prime(int a){ int c = 0; while (a != 1) { c++; if (a % 2…… 题解列表 2025年02月26日 0 点赞 0 评论 254 浏览 评分:0.0
题目2774:计算三角形面积 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ float x1,y1,x2,y2,x3,y3; dou…… 题解列表 2025年02月26日 1 点赞 0 评论 480 浏览 评分:10.0
C语言简单解法 摘要:此题较为基础,需要一点逻辑思维#includeint main(void){ long long a,b,c,n1=0,n2=0; double n3=0; scanf…… 题解列表 2025年02月26日 2 点赞 0 评论 1173 浏览 评分:10.0