题解列表

筛选

自定义函数之数字后移

摘要:解题思路:用两层for循环,第一层为后面要移到前面的x个数,第二层为从后面开始一个一个向前移注意事项:参考代码:#include<stdio.h>int main(){    int i,j,n,x,……

自定义函数之整数处理

解题思路:用两个变量t1,t2复制数组第一个数和最后一个数,分别以他们为标兵,进行比较,再用新变量n1,n2复制符合条件的下标,再用a[n1/n2]=t1/t2来把对应的原值复制到下标为n1/n2的位置注意事项:要分别用for循环来比较,不然a[0]或a[9]不对参考代码:#include

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>typedef struct stu_node{    int data;    struct st……

快速排序法

解题思路:先创建一个数组,输入四个整数,再找随便找到数组其中的一个数值定义为x(我在这里找的时中间值),定义两个指针i和j分别指向数组的最左端和最右端。然后两个指针从两端开始向x扫描,当左指针指向的数据大于x时停止,当右指针指向的数据小于x时停止,

行程长度编码

参考代码:```c#include#include#includeintmain(){chara[1000];gets(a);intlen=strlen(a);charc;for(inti=0;i

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <string.h>#define maxsize 100typedef struct{    double sco……

术式反转 赫

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct _fushu{ int va……

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>#include<stdlib.h>#define maxsize 100000typedef st……

结构体之时间设计

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int judge(int n) {     if (n % 4 == 0 && ……

找第一个只出现一次的字符

参考代码:```c#include#includeintmain(){chara[100000];gets(a);intlen=strlen(a);charc;intk=-1;//k不能设0,不然万一a[0]是第一个只出现一次的字符,就错了for(inti=0;i