输出结果大致如下:

来源:百度知道 编辑:UC知道 时间:2024/06/24 19:12:59
Enter the type to store:
<1>long
<2>double
<3>integer
Enter your choice:_____
How many element you want to sort:____
(Entering the element)
Enter the sorting methord you use:
<1>Bubble
<2>Insertion
<3>Selection
Enter your choice:____
需要具体答案!谢谢!!!初学者不需要太复杂语句!谢谢!!

我没用malloc,你别越界就行!
#include<stdio.h>
#include<stdlib.h>
void Bubble(int n[],int mark,int upper);
void Insertion(int n[],int mark,int upper);
void Selection(int n[],int mark,int upper);
void main()
{
int a,b,c,arr[100];
printf("Enter the type to store:\n");
printf("<1>long\n<2>double\n<3>integer\n");
printf("Enter your choice:");
scanf("%d",&a);
printf("How many element you want to sort:");
scanf("%d",&b);
printf("Enter them:\n");
for(int i=0;i<b;i++)
scanf("%d",&arr[i]);
printf("Enter the sorting methord you use:\n");
printf("<1>Bubble\n<2>Insertion\n<3>Selection\n");
printf("Enter the choice: ");
scanf("%d",&c);
if(c==1)
Bubble(arr,a,b