Last change
on this file since 910 was
843,
checked in by devigne, 10 years ago
|
RWT Commit : Add soft directory.
Soft directory contains scripts used to validate the RWT protocol
|
File size:
482 bytes
|
Rev | Line | |
---|
[843] | 1 | |
---|
| 2 | |
---|
| 3 | #include "functions.h" |
---|
| 4 | #include "time.h" |
---|
| 5 | #include <iostream> |
---|
| 6 | |
---|
| 7 | int main(int argc, char** argv){ |
---|
| 8 | |
---|
| 9 | srand(time(NULL)); |
---|
| 10 | |
---|
| 11 | if (argc != 2){ |
---|
| 12 | std::cerr << "Erreur" << std::endl; |
---|
| 13 | std::cerr << "Utilisation : genere_ML_CL <nb_max>" << std::endl; |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | int nb_max = atoi(argv[1]); |
---|
| 17 | if (nb_max <= 0){ |
---|
| 18 | std::cerr << "Erreur : nb_max doit etre superieur ou egal a 1" << std::endl; |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | int nb = randint(1,nb_max); |
---|
| 22 | |
---|
| 23 | std::cout << nb << std::endl; |
---|
| 24 | |
---|
| 25 | return 0; |
---|
| 26 | } |
---|
| 27 | |
---|
Note: See
TracBrowser
for help on using the repository browser.