Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <ctime>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5.  
  6. {
  7. int a[10];
  8. int b =0;
  9. do
  10. {
  11.  
  12.  
  13. srand( time (NULL));
  14. cout << "losuje... " << ((rand()%7)+4) <<endl;
  15. b++;
  16.  
  17. }while(b<10);
  18.  
  19. cout << "teraz zsumujemy je..." << endl;
  20. b=0;
  21. do
  22. {
  23. cout << (a[b] + a[b++]);
  24. }while(b<10);
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement