fork(1) download
  1. #include <stdio.h>
  2. #define N 10
  3. int main()
  4. {
  5. int a[N],i,j;
  6. for (i = 0; i < N; ++i)
  7. scanf("%d", a + i);
  8. for (j = 10; j ; --j) {
  9. for (i = 0; i < j; ++i) {
  10. printf("%d ", a[i] % 10);
  11. a[i] += a[i + 1];
  12. }
  13. putchar('\n');
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 1836KB
stdin
7 5 6 5 4 5 7 1 3 2
stdout
7 5 6 5 4 5 7 1 3 2 
2 1 1 9 9 2 8 4 5 
3 2 0 8 1 0 2 9 
5 2 8 9 1 2 1 
7 0 7 0 3 3 
7 7 7 3 6 
4 4 0 9 
8 4 9 
2 3 
5