資源簡介
C++實戰源碼-繪制余弦曲線(入門級實例070).zip
代碼片段和文件信息
//?Cosine.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?
#include?
int?main()
{
double?y;
int?x?m;
for?(y?=?1;?y?>=??-?1;?y?-=?0.1) //0到π,π到2π分別繪制21個點
{
m?=?acos(y)?*10;? //求出對應的橫坐標位置
for?(x?=?1;?x? {
printf(“?“); //畫*前畫空格數
}
printf(“*“);? //畫*
for?(;?x?62-m;?x++) //畫出對稱面的*
{
printf(“?“);
}
printf(“*\n“);
}
getch();
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????531??2010-09-08?10:32??Cosine\Cosine.cpp
?????文件????????4536??2010-09-08?10:24??Cosine\Cosine.dsp
?????文件?????????537??2010-09-08?10:24??Cosine\Cosine.dsw
?????文件?????????293??2010-09-08?10:24??Cosine\StdAfx.cpp
?????文件?????????769??2010-09-08?10:24??Cosine\StdAfx.h
- 上一篇:C++實戰源碼-指針作為函數的參數
- 下一篇:C++實戰源碼-使用滾動條顯示大幅位圖
評論
共有 條評論