Skip to content

Commit b549cd3

Browse files
authored
Update random.cpp
1 parent 0147d23 commit b549cd3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Random Number/random.cpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
#include <cstdlib>
2-
#include <ctime>
3-
#include <iostream>
1+
#include <bits/stdc++.h>
42

53
int main (int argc, char const* argv[])
64
{
75
srand((unsigned)time(0));
8-
int maior = 100;
9-
int menor = 30;
10-
int aleatorio = rand()%(maior-menor+1) + menor;
11-
std::cout << "Numero Aleatorio = " << aleatorio << std::endl;
6+
int u = 100;
7+
int d = 30;
8+
int r = rand()%(u-d+1) + d;
9+
std::cout << "Random Number = " << r << std::endl;
1210
return 0;
1311
}

0 commit comments

Comments
 (0)