#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...
-
filed in Computers , Lattice Boltzmann Method , Personal on Jan.29, 2010 MPI in CodeBlocks Codeblocks is great application devel...
-
this posting is modified from http://aganse.blogspot.com/2012/05/installing-g77-on-ubuntu-1004-1110.html However, g77 is no longer being m...
-
Step 1: Download and install Codeblocks and choose the default GNU GCC compiler. Step 2: Create a new test project. To ensure the openmp ...
-
The OpenMP framework is a powerful way of doing concurrent programming in C, C++, and Fortran. The GNU Compiler Collection (GCC) version 4....
-
For a small robot project I'm working on I needed a way to measure the robot's progress across the floor. There are various poss...
-
Hướng dẫn cài đặt thư viện Open MPI - Cài đặt Open MPI: Download bản mới nhất của Open MPI openmpi-1.2.3.tar.gz tại : http://ww...
-
1.1. CẤU HÌNH TRUY CẬP TCP WRAPPER a) Cài đặt TCP Wrapper [root@linux ~]# yum -y install tcp_wrappers b) Kiểm t...
-
Phần mềm học anh văn hiệu quả | Longman Dictionary of Contemporary English 5th Edition [Từ điển anh ngữ] Longman Dictionary of Co...
-
Region of Interest is a rectangular area in an image, to segment object for further processing. The ilustration is shown in Figure 1 below...