JakubKaczmarek_123

zadanie 9

Feb 19th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <math.h>
  5. using namespace std;
  6. int A[10];
  7. int B[10];
  8. int C[10];
  9. int main(){
  10.     srand(time(NULL));
  11.     int maks;
  12. cout << "podaj maksymalna wartosc:";
  13. cin >> maks;
  14. for (int i = 0; i < 10; i++){
  15.     A[i] = rand()%maks;
  16.     B[i] = rand()%maks;
  17. }
  18. for (int i = 0; i < 10; i++) C[i] = A[i] + B[i];
  19. }
Advertisement
Add Comment
Please, Sign In to add comment