#include <stdio.h>
#include <Windows.h>
int main()
{
for (float y = 1.5f; y > -1.5f; y -= 0.1f)
{
for (float x = -1.5f; x < 1.5f; x += 0.05f)
{
float z = x * x + y * y - 1;
float f = z * z * z - x * x * y * y * y;
putchar(f <= 0.0f ? ".:-=+*#%@"[(int)(f * -8.0f)] : ' ');
}
putchar('');
}
system("pause");
return 0;
}
#include <stdio.h>
#include <Windows.h>
#include <math.h>
float f(float x, float y, float z)
{
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}
float h(float x, float z)
{
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f)
return y;
return 0.0f;
}
int main()
{
for (float z = 1.5f; z > -1.5f; z -= 0.05f)
{
for (float x = -1.5f; x < 1.5f; x += 0.025f)
{
float v = f(x, 0.0f, z);
if (v <= 0.0f)
{