using namespace std;
#include <iostream>
#include <stdlib.h>
#define spazi 4
int main( )
{
int altezza, altezzaTronco, numSimboli;
char simbolo,simboloTronco;
cout << "inserisci altezza albero: " ;
cin >> altezza;
cout << "inserisci simbolo da visualizzare(es @,#, o altro: " ;
cin >> simbolo;
cout << "inserisci altezza tronco: " ;
cin >> altezzaTronco;
cout << "inserisci simbolo tronco: " ;
cin >> simboloTronco;
int spaziPrima = altezza;
numSimboli= 1 ;
cout << endl;
for ( int j= 0 ; j< spazi; j++ ) cout << " " ;
cout << "B U O N N A T A L E . . ." << endl<< endl;
for ( int i= 0 ; i< altezza; i++ )
{
for ( int j= 0 ; j< spazi; j++ ) cout << " " ;
for ( int j= 0 ; j< spaziPrima; j++ ) cout << " " ;
spaziPrima-- ;
for ( int j= 0 ; j< numSimboli; j++ ) cout << simbolo;
numSimboli+ = 2 ;
cout << endl;
}
if ( altezzaTronco> altezza- 4 ) altezzaTronco = 4 ;
for ( int i= 0 ; i< altezzaTronco; i++ )
{
for ( int j= 0 ; j< spazi; j++ ) cout << " " ;
for ( int j= 0 ; j< altezza; j++ ) cout << " " ;
cout << simboloTronco<< endl;
}
cout << endl<< endl;
for ( int j= 0 ; j< spazi; j++ ) cout << " " ;
cout << "A U G U R I I I I I I I . . ." << endl<< endl;
system ( "PAUSE" ) ;
}
dXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RkbGliLmg+CiNkZWZpbmUgc3BhemkgIDQKaW50IG1haW4oKQp7CiAgaW50IGFsdGV6emEsIGFsdGV6emFUcm9uY28sIG51bVNpbWJvbGk7CiAgY2hhciBzaW1ib2xvLHNpbWJvbG9Ucm9uY287CiAgY291dDw8Imluc2VyaXNjaSBhbHRlenphIGFsYmVybzogIjsKICBjaW4+PmFsdGV6emE7CiAgY291dDw8Imluc2VyaXNjaSBzaW1ib2xvIGRhIHZpc3VhbGl6emFyZShlcyBALCMsIG8gYWx0cm86ICI7Ci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