採用された回答

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020 年 10 月 21 日

1 投票

for i =1:5
j=1;
k=1;
while j<=5-i
fprintf(' ');
j = j+1;
end
while k<=i
fprintf('*');
k = k+1;
end
fprintf('\n')
end

1 件のコメント

Dominic Garcia
Dominic Garcia 2020 年 10 月 22 日
Thank you very much sir!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by