資源簡介
C++實戰源碼-PK少年高斯(入門級實例050).zip
代碼片段和文件信息
//?PKGauss.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
int?main()
{
int?i=1sum=0;
while?(i?101)
{
sum?+=?i;
i++;
}
printf(“╔═════════════════════╗\n“);
printf(“║???使用while語句計算從數字1加到100的和????║\n“);
printf(“╠═════════════════════╣\n“);
printf(“║????????從數字1加到100的和是%d??????????║\n“sum);
printf(“╚═════════════════════╝\n“);
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????508??2010-08-06?14:15??PKGauss\PKGauss.cpp
?????文件????????4548??2010-08-06?14:04??PKGauss\PKGauss.dsp
?????文件?????????539??2010-08-06?14:04??PKGauss\PKGauss.dsw
?????文件?????????294??2010-08-06?14:04??PKGauss\StdAfx.cpp
?????文件?????????769??2010-08-06?14:04??PKGauss\StdAfx.h
- 上一篇:C++實戰源碼-數組的排序
- 下一篇:C++實戰源碼-vector模板類的應用
評論
共有 條評論