Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- float tabA[5];
- float tabB[5];
- float tabC[5];
- int a;
- int main()
- {
- srand(time(NULL));
- cout << "Podaj zakres liczb losowych" << endl;
- cout<<"Od zera do: ";
- cin >> a;
- cout<<"Suma dwoch tablic z liczbami losowymi"<<endl;
- for(int i=0; i<5; i++)
- {
- tabA[i] = tabA[i] + rand()%a;
- tabB[i] = tabB[i] + rand()%a;
- tabC[i] = tabA[i] + tabB[i];
- cout<<tabC[i]<<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment