最美C语言情书(输出心形图案)
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
putchar('o');
else
putchar(' ');
}
putchar ('\n');
}
for ( y = 0, j = 0; y >= -2; y -= 0.1 )
{
int yy = fabs(y) * 10;
m = (acos(y*0.5) * 20) - 31;
if (!(yy % 6))
j++;
for (i = 0; i < 63; i++)
{
if (m + j == i || 63 - m - j == i)
putchar('*');
else if (y >= -0.6 && ( 38 - yy == i || yy + 26 == i))
putchar('v');
else if (y >= -1.6 && y < -0.7 && (31 - sqrt(25-(12-yy)*(12-yy)) == i || 32 + sqrt(25-(12-yy)*(12-yy)) == i))
putchar('e');
else
putchar(' ');
}
printf("\n");
}
return 0;
}
/***C语言心形图案***/
# include < stdio.h >
# include < math.h >
int main ( void )
{
double y;
unsigned m, i, j;
for (y = 1; y >=0; y -= 0.1)
{
m = asin (y) * 10;
for (i = 0; i < m; i++)
putchar('e');
else if (-1.2 == y && i > 28 && i < 35)
putchar('e');
else if ((yy == 17 && i == 31) || ((i == 26) && yy == 14) || ((i == 28 || i == 34) && yy == 16))
}
putchar ('*');
for (; i < 62; i++)
{
if (31 + m == i || 62 - m == i)
putchar('*');
else if (46 - sqrt(25-(5-m)*(5-m)) == i || 46 + sqrt(25-(5-m)*(5-m)) == i || 45 - sqrt(25-(5-m)*(5-m)) == i || 45 + sqrt(25-(5-m)*(5-m)) == i)
{
putchar (' ');
}
putchar ('*');
for (; i < 31 - m; i++)
{
Hale Waihona Puke Baiduif(15 == i || 16 == i)
putchar('|');
else
if (i > 15 && i < 27 && 0 == m)
putchar('|');
else
putchar (' ');
else
putchar(' ');
}
putchar ('\n');
}
for ( y = 0, j = 0; y >= -2; y -= 0.1 )
{
int yy = fabs(y) * 10;
m = (acos(y*0.5) * 20) - 31;
if (!(yy % 6))
j++;
for (i = 0; i < 63; i++)
{
if (m + j == i || 63 - m - j == i)
putchar('*');
else if (y >= -0.6 && ( 38 - yy == i || yy + 26 == i))
putchar('v');
else if (y >= -1.6 && y < -0.7 && (31 - sqrt(25-(12-yy)*(12-yy)) == i || 32 + sqrt(25-(12-yy)*(12-yy)) == i))
putchar('e');
else
putchar(' ');
}
printf("\n");
}
return 0;
}
/***C语言心形图案***/
# include < stdio.h >
# include < math.h >
int main ( void )
{
double y;
unsigned m, i, j;
for (y = 1; y >=0; y -= 0.1)
{
m = asin (y) * 10;
for (i = 0; i < m; i++)
putchar('e');
else if (-1.2 == y && i > 28 && i < 35)
putchar('e');
else if ((yy == 17 && i == 31) || ((i == 26) && yy == 14) || ((i == 28 || i == 34) && yy == 16))
}
putchar ('*');
for (; i < 62; i++)
{
if (31 + m == i || 62 - m == i)
putchar('*');
else if (46 - sqrt(25-(5-m)*(5-m)) == i || 46 + sqrt(25-(5-m)*(5-m)) == i || 45 - sqrt(25-(5-m)*(5-m)) == i || 45 + sqrt(25-(5-m)*(5-m)) == i)
{
putchar (' ');
}
putchar ('*');
for (; i < 31 - m; i++)
{
Hale Waihona Puke Baiduif(15 == i || 16 == i)
putchar('|');
else
if (i > 15 && i < 27 && 0 == m)
putchar('|');
else
putchar (' ');