fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a, x[100], i, j;
  5. scanf("%d", &a);
  6. for (i = 0; i < 20; i++) {
  7. x[i] = i + 1;
  8. }
  9. for (i = 19; i > 20 - a; i--) {
  10. x[i] = x[i - 1];
  11. }
  12. x[20 - a] = 20;
  13.  
  14. for (i = 0; i < 20; i++) { printf("%d ", x[i]); }
  15. return 0;
  16.  
  17. }
  18.  
Success #stdin #stdout 0s 5284KB
stdin
5
stdout
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 20 16 17 18 19