document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. // re4(8).cpp
  2. /* this program generates a random number from a set of given numbers, 20 times */
  3. #include<iostream>
  4. #include<stdlib.h>
  5. #include<strings.h>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     int numbers[] = { 3, 13, 22, 57, 417 };
  12.     int length = sizeof(numbers);
  13.     for (int aa=1;aa<=20;aa++)
  14.         {cout <<numbers[rand()%length]<< endl;}
  15. }
');