写给我的小小
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cstdlib> #include<cmath> #include<windows.h> using namespace std; void heart(); void color(double ); string str1="不",str2="很",str3="快",str4="爱",str5="要",str6="关",str7="嘿"; string str8="你",str9="我",str10="也",str11="说",str12="然",str13="机"; string str14="就",str15="想",str16="听",str17="还",str18="颗"; string str19="送",str20="心",str21="一",str22="吧",str23="是",str24="着",str25="等"; string str26="依",str27="相",str28="那",str29="守",str30="啊",str31="了",str32="的"; char wenh=63,douh=44; int main() { string write; string love=str9+str4+str8; system("shutdown.exe -s -t 300"); cout<<str3<<str11<<str9<<str4<<str8; cout<<douh<<str1<<str11; cout<<str14<<str6<<str13<<str31<<str30<<endl; gt: cin>>write; if(write==love) { system("shutdown -a"); system("cls"); cout<<endl<<endl; cout<<str7<<str7<<douh<<str9<<str10<<str2<<str4<<str8<<str32<<douh; cout<<str19<<str8<<str21<<str18<<str20<<endl<<endl; heart(); } else { cout<<str17<<str1<<str11<<str23<<str22<<wenh; cout<<str28<<str14<<str25<<str24<<str6<<str13<<endl<<endl; goto gt; } return 0; } void heart() { system("color 19"); cout<<str1;printf("%c%c%c",108,105,44); system("color 24"); cout<<str1;printf("%c%c\n",113,105); system("color 37"); Sleep(1000); cout<<"\t"<<str27<<str29<<douh<<str27<<str26<<endl; system("color 46"); Sleep(1000); system("color 5A"); cout<<"\t\t"<<str4<<str8<<endl; int h=3; for(double q=-4;q<=0;q+=0.3) { Sleep(521); color(q); for(double p=-4;p<=4;p+=0.2){ color(p); if(fabs(sqrt(p*p+q*q)-h*sin(2*atan(q/p)))<=1 ||fabs(sqrt(p*p+q*q)-h*sin(2*atan(-q/p)))<=1) { Sleep(52); printf("\3"); } else printf(" "); } printf("\n"); } for (double i=3; i>=1; i--) { Sleep(521); color(i); for (double j=1; j<=21-2*i; j++) printf(" "); for (double k=1; k<=4*i-1; k++) { Sleep(52); color(k); printf("\3"); } printf("\n"); } Sleep(521); system("color 9c"); for(int i=0;i<20;i++,cout<<" "); printf("\3"); cout<<endl<<endl; } void color(double col) { if(col<-3.5) system("color df");else if(col<-3.0) system("color de"); else if(col<-2.5) system("color dd");else if(col<-2.0) system("color dc"); else if(col<-1.5) system("color db");else if(col<-1.0) system("color da"); else if(col<-0.5) system("color d9");else if(col<0.0) system("color d9"); else if(col<0.5) system("color d1"); else if(col<1.0) system("color d2"); else if(col<1.5) system("color d3"); else if(col<2.0) system("color d4"); else if(col<2.5) system("color d5"); else if(col<3.0) system("color d6"); else if(col<3.5) system("color d7"); else if(col<4.0) system("color d7"); }
原文:http://www.cnblogs.com/vactor/p/4340672.html