Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- cout << "losuje liczbe" << endl;
- double T[10];
- srand(time(NULL));
- double suma=0,iloczyn=1;
- for (int i=0; i<10; i++)
- {
- T[i]=-10+(double)rand()/RAND_MAX*(33);
- suma=suma+T[i];
- if (T[i]<6)
- {
- iloczyn=T[i]*iloczyn;
- }
- }
- cout<<"suma: "<<suma<<endl;
- cout<<"iloczyn: "<<iloczyn<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment