fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a[30], n = 0, x;
  5.  
  6. while (n < 30) {
  7. scanf("%d", &x);
  8. if (x < 0) break;
  9. a[n++] = x;
  10. }
  11.  
  12. for (int i = n - 1; i >= 0; i--) {
  13. printf("%d ", a[i]);
  14. }
  15. printf("\n");
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344 5344