#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<windows.h>
int main(){
float x,y,value;
int textIndex=0;
char text[]="I Love You";
int textLen=10;
system("color 0c");
for(y=1.5f;y>-1.5f;y-=0.1f){
for(x=-1.5f;x<1.5f;x+=0.05f){
value = pow((x * x + y * y - 1.0f), 3) - (x * x * y * y * y);
if(value<=0.0f){
putchar(text[textIndex]);
textIndex=(textIndex+1)%textLen;
}
else{
putchar(' ');
}
}
putchar('\n');
}
getchar();
return 0;
}
评论区