题解列表
出圈(典型的约瑟夫环问题)
摘要:```c
#include
int f(int n,int m){
int i,s=0;
for(i=2;i……
C语言代码,新手可看
摘要:解题思路:可以使用子函数,但是没必要。就是使用两次循环,实现循环的嵌套;使用<math.h>头文件,使得内层循环范围缩小,加快程序运行。注意事项:参考代码:#include<stdio.h>#incl……
C语言-进制转换 利用栈来进行进制转换
摘要:解题思路:大家都知道C语言中可以直接通过格式输出来达到对一个数进行转换进制的目的,最近在学习栈的过程中,发现也可以使用栈来转换进制,没有什么特别的亮点,纯属写着玩玩,嘿嘿。 题目要求输入……
C语言-报数问题 简单数组法
摘要:解题思路:
题设要求输入一个正整数n,即表示n个人围成一圈,且分别编号1~n,由编号为1的人开始从1到3报数,报到3的人退出,那么最后只会留下一个人,求这个人的编号。
这里所有人是围成一……
编写题解 2842: 大整数减法
摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ int maxmine= 210; int a[maxmine]……
1253: 老王赛马
摘要:```cpp
#include
#include
using namespace std;
int main()
{
int n,i,j,a[1024],b[1024],x,cou……
1254: 考试排名
摘要:```cpp
#include
#include
using namespace std;
typedef struct BSTree *BST;
struct BSTree
{
……
1255: 蓝桥杯算法提高-能量项链
摘要:```cpp
#include
#include
using namespace std;
typedef long long LL;
namespace IO
{
inline……
1256: 诡秘的余数
摘要:```cpp
#include
#include
using namespace std;
int main()
{
char x[2000];
int n;
……