1. Could you please rewrite my source becouse i want to know what it would look like.?
2. Im including all these unnecesarry headers becouse i just started and those headers use the functions i use verry often.
#include <cstdlib>
#include <iostream>
#include <string>
usingnamespace std;
int main(int argc, char *argv[]) {
string numbers; //string instead of char[]
while(true) {
cout << ">:";
getline(cin, numbers);//reads input until the next line (basically until an enter is typed)
if ( numbers == "4 8 15 16 23 42" ) { //now we can compare them with == as 'numbers' is a string
break;
}
cout << "system failure\n";
}
}
#include <cstdlib>
#include <iostream>
#include <string>
#include <dos.h>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include <unistd.h>
usingnamespace std;
int main(int argc, char *argv[]) {
system("color 2");
int i = 1;
while(i == 1){
string numbers; //string instead of char[]
while(true) {
cout << ">:";
getline(cin, numbers);//reads input until the next line (basically until an enter is typed)
Beep(2750,100);
if ( numbers == "4 8 15 16 23 42" ) { //now we can compare them with == as 'numbers' is a string
break;
}
int failurecountdown = 55;
do
{
Beep(270,500);
cout << "| system failure ";
Sleep(500);
failurecountdown--;
}
while(failurecountdown >= 1);
system("cls");
do {
Beep(1000,200);
Beep(2000,200);
cout<< "|Use emergency over-ride key";
Sleep(500);}
while(true);
}
}
}