Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <ctime>
- #include <vector>
- #include <algorithm>
- int smallest, second, third, fourth, biggest;
- int main()
- {
- int one, two, three, four, five, last;
- srand(unsigned int(time(NULL)));
- int wb[70];
- int rb[27];
- for (int i = 1; i < 70; i++)
- {
- wb[i] = i;
- }
- for (int a = 1; a < 27; a++)
- {
- rb[a] = a;
- }
- one = wb[rand() % 69 + 1];
- two = wb[rand() % 69 + 1];
- while (two == one)
- {
- two = wb[rand() % 69 + 1];
- }
- three = wb[rand() % 69 + 1];
- while ((three == two) || three == one)
- {
- three = wb[rand() % 69 + 1];
- }
- four = wb[rand() % 69 + 1];
- while (((four == one) || four == two) || four == three)
- {
- four = wb[rand() % 69 + 1];
- }
- five = wb[rand() % 69 + 1];
- while ((((five == four) || five == three) || five == two) || five == one)
- {
- five = wb[rand() % 69 + 1];
- }
- last = rb[rand() % 26 + 1];
- std::cout << one; std::cout << std::endl;
- std::cout << two; std::cout << std::endl;
- std::cout << three; std::cout << std::endl;
- std::cout << four; std::cout << std::endl;
- std::cout << five; std::cout<<std::endl; std::cout << std::endl;
- if (one < two)
- {
- smallest = one;
- second = two;
- }
- else if (one > two)
- {
- smallest = two;
- second = one;
- }
- if (three < smallest)
- {
- third = second;
- second = smallest;
- smallest = three;
- }
- else if (three < second)
- {
- third = second;
- second = three;
- }
- else if (three > second)
- {
- third = three;
- }
- if (four < smallest)
- {
- fourth = third;
- third = second;
- second = smallest;
- smallest = four;
- }
- else if (four < second)
- {
- fourth = third;
- third = second;
- second = four;
- }
- else if (four < third)
- {
- fourth = third;
- third = four;
- }
- else if (four > third)
- {
- fourth = four;
- }
- if (five < smallest)
- {
- biggest = fourth;
- fourth = third;
- third = second;
- Second = smallest;
- smallest = five;
- }
- else if (five < second)
- {
- biggest = fourth;
- fourth = third;
- third = second;
- second = five;
- }
- else if (five < third)
- {
- biggest = fourth;
- fourth = third;
- third = five;
- }
- else if (five < fourth)
- {
- biggest = fourth;
- fourth = five;
- }
- else if (five > fourth)
- {
- biggest = five;
- }
- std::cout << smallest; std::cout << std::endl;
- std::cout << second; std::cout << std::endl;
- std::cout << third; std::cout << std::endl;
- std::cout << fourth; std::cout << std::endl;
- std::cout << biggest; std::cout << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement