1156题解(C语言) 摘要:```c #include #include // 计算数字每位的立方和,并判断该和是否等于原数字 int fun(int i) { int n = i, sum = 0; …… 题解列表 2024年08月29日 0 点赞 0 评论 184 浏览 评分:0.0
链表合并(先排序,后合并)不用排序算法 摘要:这个题好像有两种思路: 1.先合并,后排序 2.先排序,后合并 看了大家的解法都是第一种思路,我想试一下第二种思路。因为两个链表从键盘输入的时候是学号是无序的,所以我想能不能创建链表的时候就按学…… 题解列表 2024年08月30日 0 点赞 0 评论 254 浏览 评分:0.0
1198: 取石子游戏 摘要:核心: 威佐夫博弈 a == (int)((b - a) * ((sqrt(5) + 1) / 2)):先手输,其他则先手赢代码:from math import sqrt while T…… 题解列表 2024年08月30日 0 点赞 0 评论 168 浏览 评分:0.0
1197: 发工资咯(贪心算法) 摘要:核心:票票从大开始扣,数量是最少的代码:while True: l = [int(x) for x in input().split()] n = l[0] if n =…… 题解列表 2024年08月30日 0 点赞 0 评论 302 浏览 评分:0.0
1159题解(C语言) 摘要:```c #include #define MAX 101 void fun(int n, int m) { int a[MAX]; // 存储生成的数字的数组 int …… 题解列表 2024年08月30日 0 点赞 0 评论 499 浏览 评分:0.0
各位大佬看看我的 摘要:解题思路:注意事项:参考代码:#include <stdio.h>void SumAge(char a[4]) { for (size_t i = 0; i <4; i++) { …… 题解列表 2024年08月31日 1 点赞 0 评论 172 浏览 评分:0.0
简单的a+b (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b)cout…… 题解列表 2024年09月01日 0 点赞 0 评论 450 浏览 评分:0.0
定义一个带参的宏,使两个参数的值互换,并写出程序,输入两个数作为使用宏时的实参。输出已交换后的两个值。 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#pragma warning(disable : 4996)// 定义一个带参的宏,用于交换两个数的值#define chang(a…… 题解列表 2024年09月01日 1 点赞 0 评论 717 浏览 评分:0.0
输入两个整数,求他们相除的余数。用带参的宏来实现,编程序。 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#pragma warning(disable : 4996)#define AUM(a,b) c=a%b;int main(){ …… 题解列表 2024年09月01日 0 点赞 0 评论 477 浏览 评分:0.0
[编程入门]宏定义练习之三角形面积 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#pragma warning(disable : 4996)#include <math.h>#define AUM(a,b,c) …… 题解列表 2024年09月01日 0 点赞 0 评论 274 浏览 评分:0.0