1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
#include <iostream>
#include <windows.h>
using namespace std;
string g;
float l;
void playnote (string g, float l)
{
string n = g;
if (n == "A"||"a"){
Beep(2750,l*1000);
cout << "A";
}
else if(n == "B"||"b"){
Beep(3087,l*1000);
cout << "B";
}
else if(n == "C"||"c"){
Beep(1637,l*1000);
cout << "C";
}
else if(n == "D"||"d"){
Beep(1835,l*1000);
cout << "D";
}
else if(n == "E"||"e"){
Beep(2060,l*1000);
cout << "E";
}
else if(n == "F"||"f"){
Beep(2183,l*1000);
cout << "F";
}
else if(n == "G"||"g"){
Beep(2450,l*1000);
cout << "G";
}
}
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);
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);
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);
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);
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);
playnote("E", 0.4);
playnote("E", 0.4);
playnote("D", 0.4);
playnote("D", 0.4);
playnote("C", 0.4);
cout << "thanks for listening <3";
system("pause >nul");
}
//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
|