#include <stdio.h> #include<math.h> int main ( void ) { double y; int yy, m, n, x; for ( yy = 0; yy <= 20; yy++ ) { y = 0.1 * yy; m = acos( 1 - y ) * 10; n = 45 * ( y - 1 ) + 31; for ( x = 0; x <= 62; x++ ) { if ( x == m && x == n ) printf ( "+" ); else if ( x == n ) printf ( "+" ); else if ( x == m || x == 62 - m ) printf ( "*" ); else printf ( " " ); } printf ( "\n" ); } return 0; }
#include <math.h> #include <stdio.h> int main (void) { double y; int x, m, n; for (y = 0; y <= 2; y += 0.1) { m = acos(1 - y) * 10; n = 45 * (y - 1) + 31; for (x = 0; x < 63; x++) { if (x == m && x == n) putchar ('^'); else if (x == n) putchar ('+'); else if (x == m || x == 63 - m) putchar ('*'); else putchar (' '); } putchar ('\n'); } return 0; }
原文地址:http://blog.csdn.net/u011694809/article/details/46121257