Advertisement
informaticage

piramide

Jun 5th, 2023
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int l;
  5. scanf("%d", &l);
  6.  
  7. for(int i = 1; i <= l; i++) {
  8. // N - I + I fa sempre N
  9.  
  10. // Allinea a destra con N - I spazi
  11. for(int j = 0; j < l - i; j++) {
  12. printf(" ");
  13. }
  14.  
  15. // Mi stampa I asterischi
  16. for(int j = 0; j < i; j++) {
  17. printf("%c ", 219);
  18. }
  19.  
  20. printf("\n");
  21. }
  22.  
  23. return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement