• 大小: 2.74KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-01
  • 标签:

资源简介

C++实战源码-数组冒泡排序法(入门级实例121).zip

资源截图

代码片段和文件信息

// array.cpp : Defines the entry point for the console application.
//

#include “stdafx.h“
#include “iostream.h“
int main()
{
int ijt;
int a[10];
//从键盘为数组元素赋值
for(i=0;i<10;i++)
{
cout<<“a[“< cin >>a[i];
}
for(i=0;i<9;i++)
{
for(j=0;j<9-i;j++)
{
if(a[j] > a[j+1])
{
t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
}
}
cout<<“输出数组:“<<“\n“;
for(i=0;i<10;i++)
{
cout< if((i+1)%3 == 0)
{
cout<<“\n“;
}
}
cout<<“\n“;
}



 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         541  2010-07-14 10:21  array\array.cpp
     文件        4524  2010-07-14 10:20  array\array.dsp
     文件         535  2010-07-14 10:20  array\array.dsw
     文件         292  2010-07-14 10:20  array\StdAfx.cpp
     文件         769  2010-07-14 10:20  array\StdAfx.h

评论

共有 条评论