/***sin(x)和cos(x)图像同时显示***/ # include < stdio.h > # include < math.h > int main ( void ) { double y; int x, m, n; for ( y = 1; y >= -1; y -= 0.1 ) { m = acos( y ) * 10; n = asin( y ) * 10; for ( x = 0; x <= 63; x++ ) { if ( n > 0 ) { if ( x == m || x == 63 - m || x == n || x == 31 - n ) printf ( "*" ); else printf ( " " ); } else { if ( x == m || x == 63 - m || x == 32 - n || x == 62 + n ) printf ( "*" ); else printf ( " " ); } } printf ( "\n" ); } return 0; }
原文地址:http://blog.csdn.net/u011694809/article/details/46121055