/*love.h*/ #include #include #include struct O//圆心结构、焦点结构 { }; const int R = 20;//小圆半径 const O o[2] = { { 20, 20 }, { 60, 20 } };//圆心坐标 const int L = 63;//抛物线准线 const O f[2] = { { 50, 15 }, { 30, 15 } };//抛物线焦点坐标 void gotoxy(int x, int y) { } using namespace std; COORD coord = { x, y }; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); int x; int y; /*C++输出爱心*/ #include "love.h" int main() { } 上面是两个半圆,下面是两条抛物线相交在一起 高中圆锥曲线没学好。。抛物线的焦点和准线是我试出来的,觉得别扭的话可以自己计算一个好一点的弧度去修改~ int x, y; //上半 for (y = 0; y <= 13;y++) for (x = 0; x <= 80; x++) { } //下半 for (y = 14; y <= 65; y++) { } cout << endl; return 0; for (x = 0; x <= 40; x++) if ((int)sqrt(pow(x - f[0].x, 2) + pow(y - f[0].y, 2)) == L - y ) { } if ((int)sqrt(pow(x - f[1].x, 2) + pow(y - f[1].y, 2)) == L - y) { } gotoxy(x, y); cout << "\3"; gotoxy(x, y); cout << "\3"; if ((int)sqrt(pow(x - o[0].x, 2) + pow(y - o[0].y, 2)) == 20 || (int)sqrt(pow(x - o[1].x, 2) + pow(y - { } gotoxy(x, y); cout << "\3"; o[1].y, 2)) == 20) for (x = 41; x <= 80; x++) 本文来源:https://www.wddqw.com/doc/53c33b173169a4517723a3dd.html