- 余弦函数
#include<iostream>
#include<cmath>
#define PI 3.1
#define tow_PI 6.2
using namespace std;
int main()
{
double y,x;
for(y=1;y>0;y-=0.1)
{
double cx=asin(y);
for(x=0;x<cx;x+=0.1) cout<<" ";
cout<<"*";
for(;x<PI-cx;x+=0.1) cout<<" ";
cout<<"*"<<endl;
}
for(;y>=-1;y-=0.1)
{
for(double t=0;t<PI;t+=0.1) cout<<" ";
double cx=abs(asin(y));
for(x=0;x<cx;x+=0.1) cout<<" ";
cout<<"*";
for(;x<PI-cx;x+=0.1) cout<<" ";
cout<<"*"<<endl;
}
return 0;
}
因篇幅问题不能全部显示,请点此查看更多更全内容