fork download
  1. #include <stdio.h>
  2.  
  3. void triangulo(int n) {
  4. for (int i = 1; i <= n; i++) {
  5. for (int j = 1; j <= i; j++) printf("%d ", j);
  6. printf("\n");
  7. }
  8. }
  9.  
  10. int main() {
  11. int n;
  12. scanf("%d", &n);
  13. triangulo(n);
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/339810/101
Success #stdin #stdout 0s 9424KB
stdin
3
stdout
1 
1 2 
1 2 3