Skip to content · ⁨الانتقال إلى المحتوى⁩

Star triangle · ⁨مثلث النجوم⁩

English

Star triangle

Print a triangle of stars four rows high: one star, then two, then three, then four.

Multiplying a string repeats it: "ab" * 3 is "ababab". Let the loop variable say how many stars each row needs.

العربية

مثلث النجوم

اطبع مثلثًا من النجوم ارتفاعه أربعة صفوف: نجم واحد، ثم اثنان، ثم ثلاثة، ثم أربعة.

ضرب السلسلة يعيد تكرارها: "ab" * 3 هو "ababab". اجعل متغير الحلقة يشير إلى عدد النجوم الذي يحتاجه كل صف.

Log in or create account · ⁨تسجيل الدخول أو إنشاء حساب⁩

IGCSE, A-Level & AP