题解 1025: [编程入门]数组插入处理

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

【C++较复杂版解法】

摘要:参考代码:#include <iostream> using namespace std; int main() {  int list[100],N,temp,i;  for(i=0;i<……
优质题解

1025: [编程入门]数组插入处理——题解

摘要:解题思路:这是常规思路,类似按身高排队一样,已经排好的队,你想插进去,找到比你矮的和比你高的前后两个人,之后的人往后退一步就行了。首先是输入只含有9个元素的数组a[10],用for循环依次输入。接着输……

利用sort函数

摘要:解题思路:利用algorithm的sort函数对插入后的数组重新进行从小到大的排序注意事项:参考代码:#include<iostream>#include<algorithm>using namesp……

数组插入处理

摘要:#include <stdio.h>int main(void){ int a[10] = { 0 }; int i; int n; int x = 1; for (i = 0; i <= 8; i+……

数组插入处理(指针法)

摘要:解题思路:利用指针的特性,将指针移位并将数字填入注意事项:参考代码:#include<stdio.h>int main(){ int a[10],i,n,m; int *p=a;  for(i=0;i……

发现题目测试bug,快来瞅瞅撒!

摘要:解题思路:注意事项:参考代码首先提供两个代码这是有漏洞的代码:#include <stdio.h>#include <stdlib.h>int main(){    int i=0,a[24]= {0……

数组插入处理

摘要:解题思路:先把要加的数放在数组的最后面,再通过比较大小寻找合适放置的位置注意事项:参考代码:#include<stdio.h>int main(){ int a[10]; int i; for(i=0……

容易理解的C语言代码

摘要:解题思路:    虽然没必要用这么复杂的方法,    但就当是温习一下快速排序的算法吧注意事项:参考代码:#include <stdio.h> int partition(int arr[], ……