题解列表

筛选

判断一年的第几天

摘要:参考代码:#include<stdio.h>struct date {    int year;    int month;    int day;};int main() {    struct d……

1159题解(C语言)

摘要:```c #include #define MAX 101 void fun(int n, int m) { int a[MAX]; // 存储生成的数字的数组 int ……

指针/引用练习之交换数字

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int swap(int *a,int *b){ int  temp; temp=*a; *a=*b; *b=temp; return ……

1157题解(C语言)

摘要:```c #include // 函数 yue_shu 用于计算一个整数 n 的所有真约数(除了它本身)的和 int yue_shu(int n){ int sum = 0; //……

题解 2773: 计算线段长度 math.h头文件

摘要:??解题思路??此题中两点之间存在四种情况:1.两点 X坐标 相同表示为: Xa == Xb解:两点 Y坐标 差值的 绝对值2.两点 Y坐标 相同表示为: Ya == Yb解:两点 X坐标 差值的 绝……

1159: 偶数求和

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() { int n, m; while(cin >> n ……

1197: 发工资咯(贪心算法)

摘要:核心:票票从大开始扣,数量是最少的代码:while True:     l = [int(x) for x in input().split()]     n = l[0]     if n =……

1198: 取石子游戏

摘要:核心:    威佐夫博弈 a == (int)((b - a) * ((sqrt(5) + 1) / 2)):先手输,其他则先手赢代码:from math import sqrt while T……

1157: 亲和数(C++)

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() { int n; cin >> n; while(……