Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by _sn ( 17 years ago )
#include <vector>
using namespace std;

int n; //ilosc figur

class Punkt
{
 public:
 int x,y;
 Punkt():x(0),y(0);
 Punkt(int a, int b):x(a),y(b);
};
 
 
class Figura
{
 public:
 int ilosc_katow, srodekX, srodekY;
 Figura():ilosc_katow(0),srodekX(0),srodekY(0);
 Figura(int a, int b, int c):ilosc_katow(a),srodekX(b),srodekY(c);
 vector<Punkt*> punkty;
};
    
    
vector<Figura*> Figury;

void costam {
 for (i=0 ; i < n ; i++) { // w pętli dla każdej z figur
  Figura* f = new Figura((3 + rand()%(k-2)),(rand()% 800),(rand()% 600));
  for(int j=1, j<f->ilosc_katow;j++) {
    Punkt* p = new Punkt(LosujPunkt(i,1),LosujPunkt(i,2));
    f->punkty.push_back(p);
  }
  Figury.push_back(f);
 }
}

 

Revise this Paste

Parent: 11799
Children: 11801
Your Name: Code Language: