Professional Documents
Culture Documents
Source
Source
#include<cstdlib>
#include <vector>
#include <windows.h>
#include <stdlib.h>
#include <fstream>
#include <string>
#include <conio.h>
#include <graphics.h>
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
ifstream cin(s);
string x;
while (1) {
if (!getline(cin, x))
return kq;
kq.push_back(x);
}
}int mau=9;
string s;
if (i == 8) {
s = may_tinh[i].substr(0, 20);
else
s = may_tinh[i].substr(0, 25);
gotoXY(x, y + i);
cout << s;
string s;
if (i == 8) {
else
s = may_tinh[i].substr(43);
cout << s;
gotoXY(x + 45 - i, y + 8);
Sleep(Time);
}//day noi
TextColor(mau);
gotoXY(x + 35 - i - 3, y + 8 - i);
if (i == 4) {
TextColor(7);
Sleep(Time * 1.5);
Sleep(Time * 1.5);
while (1) {
gotoXY(x, y + i);
gotoXY(0, 0);
Sleep(Time);
gotoXY(x + j, y + i);
if (s1[i][j] == '*') {
TextColor(mau);
}//vien trai tim nho
else
TextColor(7);
gotoXY(0, 0);
Sleep(Time);
Sleep(Time * 2);
TextColor(mau);
continue;
gotoXY(x + j, y + i);
Sleep(Time);
Sleep(Time);
gotoXY(x + 31, y + 5); cout << "@@@@@";//vien ngoai phai tren ben trai
Sleep(Time);
Sleep(Time);
Sleep(Time);
for (int i = 0; i < 4; i++) {
Sleep(Time * 2);
TextColor(7);
TextColor(mau);
gotoXY(x + j, y + 14 - i);
Sleep(Time * 2);
Sleep(Time * 3);mau++;
TextColor(mau);
gotoXY(x + 35 - i - 3, y + 8 - i);
}
}
int main() {
system("cls");
//_getch();
int x = 20, y = 2;
vector<string> s0 = input(heart_0);
vector<string> s1 = input(heart_1);
vector<string> s2 = input(heart_2);
return 0;