HOW TO MAKİNG PASCAL TRİANGLE !!!
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Emre Tutucu
le 15 Mai 2020
Commenté : Emre Tutucu
le 15 Mai 2020
how can i do this ?
1
121
12321
1234321
123454321
3 commentaires
Réponse acceptée
Geoff Hayes
le 15 Mai 2020
emre - your code needs a third loop to countdown from the middle number to 1. Just add the following code after the second loop so that you print out the missing numbers. Note that you will need to adjust the first for loop so that the spacing is created appropriately.
for j=i-1:-1:1
fprintf(' %d',j);
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!