538
برنامج يطلب من المستخدم ادخال رقم ويطبع له شكل مثلث بحسب الرقم المدخل
#include <iostream>
using namespace std;
int main()
{
int a;
cout<<"enter the number";
cin>>a;
for(int i=1;i<=a;i++){
for(int x=0;x<a-i;x++)
cout<<" "; //مسافه
for(int d=0;d<i*2-1;d++)
cout<<"*";
cout<< endl;
}
return 0;
}
09 Yan 2022, 12:02
