資源簡介
C++實戰源碼-遍歷數組(入門級實例116).zip
代碼片段和文件信息
//?array.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?“iostream.h“
int?main()
{
int?i;
float?a[6];
//遍歷從鍵盤為數組元素賦值
for(i=0;i<6;i++)
{
cout<<“a[“< cin?>>a[i];
}
//遍歷輸出數組
for(i=0;i<6;i++)
{
cout< //控制每行輸出元素個數
if(i%3==2)
{
cout<<“\n“;
}
}
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????403??2010-07-03?11:13??array\array.cpp
?????文件????????4524??2010-07-03?11:06??array\array.dsp
?????文件?????????535??2010-07-03?11:06??array\array.dsw
?????文件?????????292??2010-07-03?11:06??array\StdAfx.cpp
?????文件?????????769??2010-07-03?11:06??array\StdAfx.h
- 上一篇:C++實戰源碼-利用指針表達式操作遍歷數組
- 下一篇:C++實戰源碼-數組的排序
評論
共有 條評論