fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int n;
  6. scanf("%d", &n);
  7. printf("%d\n", n);
  8. if (n > 0)
  9. {
  10. while (n--)
  11. printf("%d\n", n);
  12. }
  13. else
  14. {
  15. while (n++)
  16. printf("%d\n", n);
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 3416KB
stdin
4
stdout
4
3
2
1
0