Hasnain's Riddle Program

CMPC :: Computing :: Programming :: C++

Go down

Hasnain's Riddle Program

Post by zodiacescuchion on Thu Feb 11, 2010 4:22 am

Code:

#include<iostream>
#include<string>
#include<windows.h>
using namespace std;

int main ()
{  string a,b,c;
   cout<<"bet you can't solve this riddle:";
   cout<<'\n';
   do
   {
   cout<<"type in two different numbers in which one is not greater than the other And the other is not greater than the first one"<<'\n'
      << "and you can't cheat by putting in the same number twice";
   cout<<'\n';
   cout<<"first number:";
   cin>> a;
   cout<<"second number:";
   cin>>b;
   if ((a>=b)&&(b>=a))
   {cout<<"hey you cheater i said you can't use the same number twice";
   Sleep(3000);
   break;
   }   
   cout<<"Haha you're wrong" <<'\n'<<"Do you give up:";
   
   cin>>c;
   }
   while ((c!="yes")&&(a!=b));
   cout<<'\n'<<"Awww Well You won. Albeit through negative means";
   Sleep(6500);
   cout<<'\n'<<"but did you really?";
   Sleep(3000);
   cout<<'\n' <<" you only won because you are a cheater and a quitter" <<'\n'<<"so in the end who really won?";
   return 0;
}
avatar
zodiacescuchion
Skid

Posts : 28

Back to top Go down

Re: Hasnain's Riddle Program

Post by Admin on Thu Feb 11, 2010 4:40 am

you could at least make a more specific title than "Program" in the programming section. Or maybe even given us a description of it before you posted the code.

Oh also good job in the code. You're learning Very Happy But a biased opinion on my part, Do statements suck Razz

_________________
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: Hasnain's Riddle Program

Post by Unchained on Thu Feb 11, 2010 6:40 am

Yea looks pretty good, who is this?
avatar
Unchained
Mod

Posts : 448

Back to top Go down

Re: Hasnain's Riddle Program

Post by Corey on Fri Feb 12, 2010 2:07 am

What's wrong with Do statements?

_________________
-Corey Hoard

(Yes, I totally copied Paul's avatar. Or, at least attempted to.)
avatar
Corey
Mod

Posts : 462

Back to top Go down

Re: Hasnain's Riddle Program

Post by Admin on Fri Feb 12, 2010 2:35 am

Corey wrote:What's wrong with Do statements?
i have to go to the end of it to see what's happening instead of just looking at line #1 of the loop (for loops have all the info in the first part so it's convenient)

_________________
avatar
Admin
Pirate King

Posts : 559

Back to top Go down

Re: Hasnain's Riddle Program

Post by Corey on Fri Feb 12, 2010 2:40 am

yeah that's true

_________________
-Corey Hoard

(Yes, I totally copied Paul's avatar. Or, at least attempted to.)
avatar
Corey
Mod

Posts : 462

Back to top Go down

Re: Hasnain's Riddle Program

Post by Unchained on Fri Feb 12, 2010 6:11 am

Besides most people usually have some sort of preference.
avatar
Unchained
Mod

Posts : 448

Back to top Go down

Re: Hasnain's Riddle Program

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

CMPC :: Computing :: Programming :: C++

 
Permissions in this forum:
You cannot reply to topics in this forum