Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <cmath>
- #include <ctime>
- using namespace std;
- typedef struct cone {
- int radius;
- int height;
- }
- CONE;
- int main()
- {
- srand(time(NULL));
- CONE cones[300];
- int bigcone = 0;
- for(int j = 0;j<300;j++)
- {
- cones[j].radius = rand()%100+1;
- cones[j].height = rand()%100+1;
- if(cones[j].radius * cones[j].height > 1000) bigcone++;
- }
- cout << "cones with volume > 1000 = " << bigcone << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement