高中的时候做的,前两天看了看,挺好玩的。
只想说,当初的代码风格,,,,咳咳,算不上风骚!
/***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; }
趣味图形之 正弦函数sin&&余弦函数cos相交
时间: 2024-10-31 02:55:51