C语言绘制余弦函数图象

 

  1. #include"stdio.h"  
  2. #include"math.h"  
  3. void main()  
  4. {  
  5.     double y;  
  6.     int x,m;  
  7.     for(y=1;y>=-1;y-=0.1)  
  8.     {  
  9.         m=acos(y)*10;  
  10.         for(x=1;x<m;x++)  
  11.             printf(" ");  
  12.         printf("*");  
  13.         for(;x<62-m;x++)  
  14.             printf(" ");  
  15.         printf("*");  
  16.         printf("\n");  
  17.               
  18.     }  

 

 

本文出自 “阿凡达” 博客,请务必保留此出处http://shamrock.blog.51cto.com/2079212/711613

posted @ 2014-08-10 10:04  商商-77  阅读(347)  评论(0)    收藏  举报