fork(2) download
  1. #include <stdio.h>
  2.  
  3. void tarefa(int r) {
  4. for (int e = 1; e <= r; e++) printf(" %d ", r);
  5. printf("\n");
  6. }
  7.  
  8. int main(int argc, char *argv[]) {
  9. int x;
  10. scanf("%d", &x);
  11. for (int j = 1; j <= x; j++) tarefa(j);
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/239574/101
Success #stdin #stdout 0s 9432KB
stdin
5
stdout
 1  
 2   2  
 3   3   3  
 4   4   4   4  
 5   5   5   5   5