fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <time.h>
  4. #include <iostream>
  5.  
  6. class Network
  7. {
  8. public:
  9. static int relations[8];
  10. };
  11.  
  12. int Network::relations[8] =
  13. {
  14. (srand(time(0)),rand() % 10 - 5),
  15. rand() % 10 - 5,
  16. rand() % 10 - 5,
  17. rand() % 10 - 5,
  18. rand() % 10 - 5,
  19. rand() % 10 - 5,
  20. rand() % 10 - 5,
  21. rand() % 10 - 5
  22. };
  23.  
  24. int main(int argc, const char * argv[])
  25. {
  26. for(auto i: Network::relations)
  27. std::cout << i << "\n";
  28. }
  29.  
  30.  
  31.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
2
-4
0
3
-2
4
-4
-5