Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <time.h>
- using namespace std;
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- class Point {
- public:
- int x,y;
- Point(int x, int y){
- this->x=x;
- this->y=y;
- }
- };
- class Square{
- public:
- Point p;
- int n;
- Square(Point p, int n)
- {
- this->p=p;
- this->n=n;
- }
- };
- int main(int argc, char** argv) {
- int n;
- cout<<"Podaj ilosc kwadratów: "<<endl;
- cin>>n;
- if (!n>0)
- {
- cout<<"Podaj liczbe wieksza od zera!"<<endl;
- }
- else
- {
- Square square;
- Point point;
- square.Square((point.Point(rand()%10, rand()%10)),n);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement