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;

}

原文地址:https://www.cnblogs.com/hxsyl/p/2416263.html