DragonTooth™
Zac look here DragonToothBanner-4
DragonTooth™
Zac look here DragonToothBanner-4
DragonTooth™
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Welcome To DragonTooth (GameDEV). Our Administrators: Emptrix, Amethyst, Shizuko~Conan, Yamino. To Contact Us, e-mail: Dragon_Tooth@live.com.
 
HomeLatest imagesSearchRegisterLog in
Welcome to DragonToothDEV Forum. We are currently not taking anymore new users, however we will accept users that has Friend's Recommendation. Members who's friends are joining please pm one of the Administrators the username of your friend's newly created account to get it activated.

 

 Zac look here

Go down 
AuthorMessage
Emptrix
Staff Administrator
Emptrix


Posts : 1218
Points : 1916
Reputation : 13
Join date : 2009-05-09
Age : 33
Location : The World That Never Was

Zac look here Empty
PostSubject: Zac look here   Zac look here EmptyTue Jun 25, 2013 1:07 pm

Code:
#include <iostream>
#include <ctime>
using namespace std;

int main() {
   srand(time(0));

   int random1;
   int random2;
   int random3;
   int temp;

   random1 = rand() % 30 + 20; //0to 29
   random2 = rand() % 31 + 20;
   random3 = rand() % 31 + 20;

   cout << "Random Number 1: " << random1 << endl;
   cout << "Random Number 2: " << random2 << endl;
   cout << "Random Number 3: " << random3 << endl;

   if (random1 < random3)   {
      temp = random1;
      random1 = random3;
      random3 = temp;
   } else if (random2 > random1) {
      temp = random2;
      random2 = random1;
      random1 = temp;
   } else {
      cout << "No change!" << endl;
   }
   cout << "First number: " << random1 << endl;
   cout << "Second number: " << random2 << endl;
   cout << "Third number: " << random3 << endl;
}
Back to top Go down
http://emptrix.tk
 
Zac look here
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
DragonTooth™ :: Help & Support :: Help & Requests-
Jump to: