Advertisement
szymski

Untitled

Jan 29th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <cstdlib>
  5. #include <time.h>
  6.  
  7.  
  8. using namespace std;
  9.  
  10.  
  11. int main()
  12. {
  13. int losowanie999 [ 999 ];
  14. int i = 0;
  15. srand( time (NULL));
  16. do{
  17. losowanie999 [ i ] = (rand() % 7) + 4;
  18. i++;
  19. }while(i < 999);
  20. i = 0;
  21. cout << "Wylosowane liczby: " << endl;
  22. do{
  23. cout << losowanie999[ i ] << ", ";
  24. i++;
  25. }while(i < 999);
  26.  
  27. int suma = 0;
  28. for(int o = 0; o < 999; o++){
  29. suma += losowanie999[o];
  30. }
  31. cout << "Wynik dodawania: " << suma << endl;
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement