Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. using namespace std;
  5. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  6.  
  7.  
  8.  
  9. class Point {
  10. public:
  11. int x,y;
  12. Point(int x, int y){
  13. this->x=x;
  14. this->y=y;
  15.  
  16. }
  17.  
  18.  
  19.  
  20. };
  21.  
  22. class Square{
  23. public:
  24. Point p;
  25. int n;
  26. Square(Point p, int n)
  27. {
  28. this->p=p;
  29. this->n=n;
  30.  
  31. }
  32.  
  33.  
  34. };
  35.  
  36. int main(int argc, char** argv) {
  37. int n;
  38. cout<<"Podaj ilosc kwadratów: "<<endl;
  39. cin>>n;
  40.  
  41. if (!n>0)
  42. {
  43. cout<<"Podaj liczbe wieksza od zera!"<<endl;
  44. }
  45. else
  46. {
  47. Square square;
  48. Point point;
  49. square.Square((point.Point(rand()%10, rand()%10)),n);
  50.  
  51. }
  52.  
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement