fork(1) download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int days;
  5. printf("Input days:");
  6. scanf("%d", &days);
  7. int x = 1;
  8. do{
  9. x = (x + 1) * 2;
  10. days--;
  11. }while (days > 1);
  12. printf("x=%d\n", x);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5332KB
stdin
10
stdout
Input days:x=1534