لسلام عليكم
ساعدوني في الحل سؤال الشيت :P تكفون علية درجات كبيرة وتسليم يوم الثلاثاء :cry:
Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find
the odd numbers then calculate the sum of odd numbers so he get the height of tree?
For example:
User enters 2331 the odd numbers are 3 ,3 and 1 the sum of them is 10 so it should print in screen this shape:
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*******
*******
*******
If he enters 1316 the sum of odd number is 5 the shape should be like this:
*
***
*****
*******
*********
***
***
هذة محاولتي
# include <iostream.h>
void main( )
{
int i , j ;
for (i =1; i<= 3 ; i++)
{
for( j = 1 ; j <= 4 ; j++)
{
cout << i ;
cout << j<< endl;
}
cout << endl;
}بليز درو علي :mellow: