Zeug
public text v1 · immutablerechteck::rechteck(int posx,int posy,int height,int width){
x=posx;
y=posy;
h=height;
b=width;
}
void rechteck::show(){
for(int k=0;k<y;k++) //Vertikale Position Y
{
cout<<endl;
}
//Erstelle Rechteck
for(int j=0;j<h;j++) //Höhe
{
for(int l=0;l<x;l++) //Horizontale Position X
{
cout<<" ";
}
for(int i=0;i<b;i++) //Breite
{
cout<<"x";
}
cout<<endl;
}
}
int main(){
rechteck r(5,10,10,20);
r.show();
}