用“*”显示一条正弦曲线
#include<stdio.h>#include<math.h>
main()
{
double y;
int x,m;
for(y=0;y<=1;y+=0.1)
{
m=asin(y)*10;
for(x=1;x<m;x++)printf(" ");
printf("*");
for(;x<31-m;x++)printf(" ");
printf("*\n");
}
for(y=0;y>=-1;y-=0.1){
m=asin(y)*10;
for(x=31;x<=m;x++)printf(" ");
printf("*");
for(;x<=62-m;x++)printf(" ");
printf("*\n");
}
}
大家帮我看看为什么图出来的不是正弦曲线啊?
谢谢~~~~