c语言,怎么运行不了(冒泡排序)

[复制链接]
查看11 | 回复1 | 2009-7-11 12:52:59 | 显示全部楼层 |阅读模式
#include "stdio.h"
void SelectSort(int sort[],int N);
void BubbleSort(int sort[],int N);
void DisplayArray(int sort[],int N);
void main()
{
int sort[20];
int N,i;
printf("Please input array length0)&&(k>0))
{k=0;
for(i=1;i<=j;i++)
if(sort[i+1]<sort)
{k=1;
sort[0]=sort;
sort=sort[i+1];
sort[i+1]=sort[0];
}
j--;
}
}

回复

使用道具 举报

千问 | 2009-7-11 12:52:59 | 显示全部楼层
代码错误了,改成这样#include "stdio.h"void SelectSort(int sort[], int N);void BubbleSort(int sort[], int N);void DisplayArray(int sort[], int N);int main(){ int sort[20]; int N, i; printf("Please input array length<20:"); scanf("%4d", &N); printf("\n"); printf("Please input your array:"); for (i = 0; i < N;...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行