dos下输出余弦函数图形

 

打印cosx)函数。按行输出,则y1-1,输出0360

 

 

 

#include <stdio.h>

#include <math.h>

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++)

printf(" ");

printf("*");

for(;x<62-m;x++)

printf(" ");

printf("*\n");

}

return 0;

}

posted @ 2012-03-25 00:35  加拿大小哥哥  阅读(210)  评论(0编辑  收藏  举报