C語言實現(xiàn)520表白代碼 祝你表白成功!
更新時間:2021年04月24日 12:26:46 作者:巖梟
這篇文章主要為大家詳細介紹了C語言實現(xiàn)520表白代碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了C語言實現(xiàn)520表白的具體代碼,供大家參考,具體內(nèi)容如下
在這個狂虐單身狗的節(jié)日,實在無聊寫了幾行也不知道向誰告白的代碼,獻丑獻丑:
#include<stdio.h>
#include<math.h>
int main()
{
float y, x, z;
printf("那一天\n");
printf("第一次遇見你\n");
printf("忘不了\n");
printf("你的容顏\n");
printf("若輕云之蔽月,如流風(fēng)之回雪\n");
printf("\n\n\n");
printf("其實\n");
printf("有一句話\n");
printf("我一直想對你說:\n");
for (double y = 2.5; y >= -1.6; y = y - 0.2)
{
for (double x = -3; x <= 4.8; x = x + 0.1)
{
(pow((x*x + y*y - 1), 3) <= 3.6*x*x*y*y*y
|| (x>-2.4 && x<-2.1 && y<1.5 && y>-1)
|| (((x<2.5 && x>2.2) || (x>3.4 && x<3.7)) && y>-1 && y<1.5)
|| (y>-1 && y<-0.6 && x<3.7 && x>2.2)) ? printf("*") : printf(" ");
}
printf("\n");
}
getchar();
}
運行效果圖:

代碼二
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define I 20
#define R 340
#include <string.h>
int main()
{
char answer[10];
printf("遇到你\n我才發(fā)現(xiàn)\n曾經(jīng)所有的條件\n似乎都成了我等你的借口\n\n");
printf("請允許我,從今往后映入你\n明媚的眼\n");
printf("輸入yes或no,點擊Enter");
printf("\n ");
scanf("%s", answer);
char b[4]="yes";
if(strcmp(answer,b)==0)
{
float y, x, z, f;
for (y = 1.5f; y > -1.5f; y -= 0.1f)
{
for (x = -1.5f; x < 1.5f; x += 0.05f)
{
z = x * x + y * y - 1;
f = z * z*z - x * x*y*y*y;
putchar(f <= 0.0f ? "*********"[(int)(f*-8.0f)] : ' ');
}
putchar('\n');
}
long time;
for (;;)
{
system("color a");
for (time = 0; time<99999999; time++);
system("color b");
for (time = 0; time<99999999; time++);
system("color c");
for (time = 0; time<99999999; time++);
system("color d");
for (time = 0; time<99999999; time++);
system("color e");
for (time = 0; time<99999999; time++);
system("color f");
for (time = 0; time<99999999; time++);
system("color 0");
for (time = 0; time<99999999; time++);
system("color 1");
for (time = 0; time<99999999; time++);
system("color 2");
for (time = 0; time<99999999; time++);
system("color 3");
for (time = 0; time<99999999; time++);
system("color 4");
for (time = 0; time<99999999; time++);
system("color 5");
for (time = 0; time<99999999; time++);
system("color 6");
for (time = 0; time<99999999; time++);
system("color 7");
for (time = 0; time<99999999; time++);
system("color 8");
for (time = 0; time<99999999; time++);
system("color 9");
}
getchar();
}
else
{
printf("\n好吧,那就相忘于江湖吧!\n");
}
return 0;
}
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
C++中浮點數(shù)、double類型如何與0值作比較詳解
浮點數(shù)在內(nèi)存中的存儲機制和整型數(shù)不同,其有舍入誤差,在計算機中用近似表示任意某個實數(shù),這篇文章主要介紹了C++中浮點數(shù)、double類型如何與0值作比較的相關(guān)資料,需要的朋友可以參考下2025-03-03
C語言中全局變量,局部變量,靜態(tài)局部變量的區(qū)分方式
這篇文章主要介紹了C語言中全局變量,局部變量,靜態(tài)局部變量的區(qū)分方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-08-08
詳解C++11 原始字符串字面量(Json字符串表達更方便)
原始字符串字面量(Raw String Literal)是C++11引入的一種字符串表示方式,用于簡化字符串的定義,特別是當字符串中包含大量特殊字符(如換行符、雙引號等)時,這篇文章給大家介紹C++11原始字符串字面量(Json字符串表達更方便)的相關(guān)知識,感興趣的朋友一起看看吧2025-03-03
C++ 17轉(zhuǎn)發(fā)一個函數(shù)調(diào)用的完美實現(xiàn)
這篇文章主要給大家介紹了關(guān)于C++ 17如何轉(zhuǎn)發(fā)一個函數(shù)調(diào)用的完美實現(xiàn)方法,文中通過示例代碼介紹的非常詳細,對大家學(xué)習(xí)或者使用C++17具有一定的參考學(xué)習(xí)價值,需要的朋友們下面跟著小編來一起學(xué)習(xí)學(xué)習(xí)吧。2017-08-08

