哈哈哈哈哈哈哈,小爱心的发现是个意外意外意外
咳咳,正题
今天本来是在LeetCode上刷题,想到了异或操作,之前没有试过字符与字符的异或,于是试了一下
#include <iostream>
using namespace std;
int main()
{
char ans;
ans = 'a' ^ 'b';
cout << ans;
std::system("pause");
return 0;
}
然后
结果让我很激动!!!
竟然是个小爱心!!!
想到网上很多心形的代码组成元素基本是是*#$&
等等这些元素,就想试一下,用小爱心组成的大爱心~~~
于是
#include <iostream>
#include "windows.h"
#include<cmath>
using namespace std;
void heartShaped()
{
float x, y;
char heart;
heart = 'a' ^ 'b';
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED); /