数字排序.cpp
来自「解压后 每个.cpp都有中文名很清楚。我是初学者」· C++ 代码 · 共 26 行
CPP
26 行
#include<stdio.h>
void main()
{
int num[10],i,m,n,temp,con;
printf("Enter the number:");
scanf("%d",&con);
for (i=0;i<con;i++)
{
printf("Enter the number %d: ",i+1);
scanf("%d",&num[i]);
}
for(m=0;m<con;m++)
{
for(n=m+1;n<con;n++)
if(num[n]>num[m])
{
temp=num[m];
num[m]=num[n];
num[n]=temp;
}
}
for(i=0;i<con;i++)
printf("the order of the number is %d: %d\n",i+1,num[i]);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?