ThatCoolGuy220
July 1st, 2011, 02:11 AM
Hi idk why it was closed but i would like to share what i did with the first challenge:
Warning Windows:
#include <cstdio>
#include <cstdlib>
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a;
string c, d, e, f, F, s;
c = " bottles of beer on the wall, ";
d = " bottles of beer";
e = "Take one down and pass it around, ";
f = " no more bottles of beer on the wall";
F = "No more bottles of beer on the wall";
s = "Go to the store and buy some more, ";
for (a = 99; a > 1; a --)
{
cout << a << c << a << d << endl << e << a - 1 << c << endl << endl;
}
cout << a << c << a << d << endl << e << f << endl << endl << F << " no more " << d << endl;
a = 99;
cout << s << a << c;
cin.get();
return 0;
}
For Linux it would be like this:
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a;
string c, d, e, f, F, s;
c = " bottles of beer on the wall, ";
d = " bottles of beer";
e = "Take one down and pass it around, ";
f = " no more bottles of beer on the wall";
F = "No more bottles of beer on the wall";
s = "Go to the store and buy some more, ";
for (a = 99; a > 1; a --)
{
cout << a << c << a << d << endl << e << a - 1 << c << endl << endl;
Sleep(8000);
}
cout << a << c << a << d << endl << e << f << endl << endl << F << " no more " << d << endl;
a = 99;
cout << s << a << c;
cin.get();
return 0;
}
I think the sleep(); function, Sleep(); on Windows, could be added for sing along LOL too bad was closed was a good thread.
Warning Windows:
#include <cstdio>
#include <cstdlib>
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a;
string c, d, e, f, F, s;
c = " bottles of beer on the wall, ";
d = " bottles of beer";
e = "Take one down and pass it around, ";
f = " no more bottles of beer on the wall";
F = "No more bottles of beer on the wall";
s = "Go to the store and buy some more, ";
for (a = 99; a > 1; a --)
{
cout << a << c << a << d << endl << e << a - 1 << c << endl << endl;
}
cout << a << c << a << d << endl << e << f << endl << endl << F << " no more " << d << endl;
a = 99;
cout << s << a << c;
cin.get();
return 0;
}
For Linux it would be like this:
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a;
string c, d, e, f, F, s;
c = " bottles of beer on the wall, ";
d = " bottles of beer";
e = "Take one down and pass it around, ";
f = " no more bottles of beer on the wall";
F = "No more bottles of beer on the wall";
s = "Go to the store and buy some more, ";
for (a = 99; a > 1; a --)
{
cout << a << c << a << d << endl << e << a - 1 << c << endl << endl;
Sleep(8000);
}
cout << a << c << a << d << endl << e << f << endl << endl << F << " no more " << d << endl;
a = 99;
cout << s << a << c;
cin.get();
return 0;
}
I think the sleep(); function, Sleep(); on Windows, could be added for sing along LOL too bad was closed was a good thread.