Posted March 04, 2012
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main ()
{
string imagoodboy;
int didiwin;
int count = 1;
do{
_if (count > 1)
__cout << "\n";
_cout << "1: Winner!\n";
_cout << "2: Sorry, not a winner :(\n";
_cout << "Please choose #1. ";
_getline (cin,imagoodboy);
_stringstream(imagoodboy) >> didiwin;
_if (count == 1)
__++count;
}while (didiwin != 1);
cout << "\n" << "--------------\n";
cout << "YAY!! I WON!!!";
cout << "\n" << "--------------\n";
return 0;
}
EDIT: Remove all the _'s. The forum software doesn't like indentations. You get the idea ;)
#include <string>
#include <sstream>
using namespace std;
int main ()
{
string imagoodboy;
int didiwin;
int count = 1;
do{
_if (count > 1)
__cout << "\n";
_cout << "1: Winner!\n";
_cout << "2: Sorry, not a winner :(\n";
_cout << "Please choose #1. ";
_getline (cin,imagoodboy);
_stringstream(imagoodboy) >> didiwin;
_if (count == 1)
__++count;
}while (didiwin != 1);
cout << "\n" << "--------------\n";
cout << "YAY!! I WON!!!";
cout << "\n" << "--------------\n";
return 0;
}
EDIT: Remove all the _'s. The forum software doesn't like indentations. You get the idea ;)
Post edited March 04, 2012 by CowboyBebop