C++实现爱心代码 爱心曲线方程 $$ x^2+(5y/4-\sqrt[2]{|x|} )=1 $$ 代码实现 1#include<iostream>2#include<cmath>3using namespace std;4 5int main()6{7 for(float y=1.3;y>=-1.1;y-=0.06){8 9 for(float x=-1.1;x<=1.1;x+=0.025)10 {11 if(x*x+pow(5.0*y/4.0-sqrt(fabs(x)),2)-1<=0)12 {13 cout<<'*';14 }15 else8 collapsed lines16 cout<<' ';17 }18 cout<<endl;19 }20 system("pause");21 return 0;22 23} 输出形状