fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int i,j,n;
  5. scanf("%d",&n);
  6. char ch='A';
  7.  
  8. for(i=1;i<=n;i++){
  9.  
  10. for(j=1;j<=n-i;j++){
  11. printf(" ");
  12. }
  13. for(j=1;j<=i;j++){
  14. printf("%c ",ch);
  15. ch++;
  16.  
  17. }
  18. printf("\n");
  19. }
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5312KB
stdin
5
stdout
        A 
      B C 
    D E F 
  G H I J 
K L M N O