// 绘制余弦曲线.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double y;
int x, m;
for (y=1; y>=-1; y-=0.1)
{
m = acos(y)*10;// 求出对应的横坐标位置
for (x=1; x<m; ++x)//画*前空格数
cout << " ";
cout << "*";//画*
for (; x<62-m; ++x)//画出对称的*
cout << " ";
cout << "*\n";
}
return 0;
}
