#include <stdio.h>1#include <math.h>23#define inv_of_sqrt3 0.577350269245int main()6{7double x, y, z;8unsigned index;9for (y = 1; y >= -1; y -= 0.05)10{11for (x = -1; x <=1; x += 0.025)12{13z = sqrt(1.0 - x*x - y*y);1415// the value of x+y+z is between -sqrt3 and +sqrt316// 0.5 is for rounding (si4 she4 wu3 ru4)17index = ((x + y + z) * inv_of_sqrt3 + 1.0) * 5.0 + 0.5;18putchar(x*x + y*y > 1.0 ? 'M' : "@@%#*+=;:. "[index]);19}20putchar('\n');21}22return 0;23}242526