#include <iostream>
#include <windows.h>
using namespace std;
//twinkle twinkle
//CC GG AA G
//FF EE DD C
//GG FF EE D
//GG FF EE D
//CC GG AA G
//FF EE DD C
void playnote (char g, float l)
{
char n = g;
if (n == 'A'||'a'){
Beep(2750,l*1000);
cout <<n;
}
else if(n == 'B'||'b'){
Beep(3087,l*1000);
cout << n;
}
else if(n == 'C'||'c'){
Beep(1637,l*1000);
cout << n;
}
else if(n == 'D'||'d'){
Beep(1835,l*1000);
cout << n;
}
else if(n == 'E'||'e'){
Beep(2060,l*1000);
cout << n;
}
else if(n == 'F'||'f'){
Beep(2183,l*1000);
cout << n;
}
else if(n == 'G'||'g'){
Beep(2450,l*1000);
cout << n;
}
}
int main() {
playnote('C', 0.4);
playnote('C', 0.4);
playnote('G', 0.4);
playnote('G', 0.4);
playnote('A', 0.4);
playnote('A', 0.4);
playnote('G', 0.4);
Sleep(400);
cout<<endl;
playnote('F', 0.4);
playnote('F', 0.4);
playnote('E', 0.4);
playnote('E', 0.4);
playnote('D', 0.4);
playnote('D', 0.4);
playnote('C', 0.4);
Sleep(400);
cout<<endl;
playnote('G', 0.4);
playnote('G', 0.4);
playnote('F', 0.4);
playnote('F', 0.4);
playnote('E', 0.4);
playnote('D', 0.4);
playnote('G', 0.4);
Sleep(400);
cout<<endl;
playnote('G', 0.4);
playnote('F', 0.4);
playnote('F', 0.4);
playnote('E', 0.4);
playnote('D', 0.4);
playnote('C', 0.4);
playnote('C', 0.4);
Sleep(400);
cout<<endl;
playnote('G', 0.4);
playnote('G', 0.4);
playnote('A', 0.4);
playnote('A', 0.4);
playnote('G', 0.4);
playnote('F', 0.4);
playnote('F', 0.4);
Sleep(400);
cout<<endl;
playnote('E', 0.4);
playnote('E', 0.4);
playnote('D', 0.4);
playnote('D', 0.4);
playnote('C', 0.4);
cout<<endl;
cout << "thanks for listening <3";
return 0;
}
Bài đăng phổ biến
-
1.1.1. THỰC HÀNH 4: THIẾT LẬP FORUM SỬ DỤNG PHP VÀ MYSQL Cài đặt MyBB Gói mã nguồn mở được cung cấp hoàn toàn miễn phí tại tran...
-
This article will show how to install the Smarty Template Engine with WampServer . This article is a modified version of the Basic Instal...
-
Smarty and XAMPP configuration on Windows Labels: Configuration , Installation , Smarty , Windows , XAMPP Smarty is a we...
-
This article will show how to an extended setup of Smarty with WampServer. This article is a modified version of Extended Setup on ...
-
KỸ THUẬT HIỂN THỊ VÀ ĐIỀU PHỐI HIỂN THỊ HÌNH ẢNH Nguyễn Phát Nhựt, Đoàn Thiện Minh Tóm tắt Trong bài báo này, tác giả trình bày một phương ...
-
Eclipse – C/C++ (CDT), Python (PyDev), and Qt (Qt4) Plugins Installation Tutorial for Ubuntu 10.04 Posted on September 28, 2010 by Gre...
-
Cách cài đặt Smarty trên Windows. I wish I had this info when I started, the documentation is geared towards *nix and is confusing but it w...
-
My last post described how to install PEAR with PHP 5.3.0 on a Windows XP machine . Here, I will describe how I was able to get PEAR runn...
-
PVM is a software system that allows you to combine a number of computers which are connected over a network into a Parallel Virtual Machine...
-
Cài đặt SMARTY LIBRARY Copy các file thư viện Smarty vào /usr/local/lib/php/Smarty/ $> cd YOUR_DOWNLOAD_DIRECTORY $> gtar -zxvf...