C语言:生成20个随机数,然后把它们排序,最后要把排序前和排序后的数都显示出来.原题是:Write a program that uses a list of 20 randomly generated numbers and put the list in order using a selection sort. Display both t
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/11 12:32:31
![C语言:生成20个随机数,然后把它们排序,最后要把排序前和排序后的数都显示出来.原题是:Write a program that uses a list of 20 randomly generated numbers and put the list in order using a selection sort. Display both t](/uploads/image/z/8880895-55-5.jpg?t=C%E8%AF%AD%E8%A8%80%EF%BC%9A%E7%94%9F%E6%88%9020%E4%B8%AA%E9%9A%8F%E6%9C%BA%E6%95%B0%2C%E7%84%B6%E5%90%8E%E6%8A%8A%E5%AE%83%E4%BB%AC%E6%8E%92%E5%BA%8F%2C%E6%9C%80%E5%90%8E%E8%A6%81%E6%8A%8A%E6%8E%92%E5%BA%8F%E5%89%8D%E5%92%8C%E6%8E%92%E5%BA%8F%E5%90%8E%E7%9A%84%E6%95%B0%E9%83%BD%E6%98%BE%E7%A4%BA%E5%87%BA%E6%9D%A5.%E5%8E%9F%E9%A2%98%E6%98%AF%EF%BC%9AWrite+a+program+that+uses+a+list+of+20+randomly+generated+numbers+and+put+the+list+in+order+using+a+selection+sort.+Display+both+t)
4N; 98+{29f2 hi4-A}c-8rCF8f0xG: D;Y:َК==f.N،I%9/W+~ցZYGB\b8/lTCi;n
C语言:生成20个随机数,然后把它们排序,最后要把排序前和排序后的数都显示出来.原题是:Write a program that uses a list of 20 randomly generated numbers and put the list in order using a selection sort. Display both t
C语言:生成20个随机数,然后把它们排序,最后要把排序前和排序后的数都显示出来.
原题是:Write a program that uses a list of 20 randomly generated numbers and put the list in order using a selection sort. Display both the initial list and the recorded list.
我用的软件是Win-TC.
写了好久只写出来怎么随机生成,好泄气,好想放弃了.
而且我连题目都看的不是很明白,不知道是不是理解错了.
#include
#include
#include
int main()
{ int nums[20],num[20];
int i;
srand(time(NULL));
for (i=1;i
C语言:生成20个随机数,然后把它们排序,最后要把排序前和排序后的数都显示出来.原题是:Write a program that uses a list of 20 randomly generated numbers and put the list in order using a selection sort. Display both t
#include
#include
#include
int main()
{
int nums[21],num[21]; /*你的角标从1开始,这里的20就不够了*/
int i,j;
int index,temp;
srand(time(NULL));
for (i=1;i