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. while(days>1)
  9. {
  10. x = (x + 1) * 2;
  11. days--;
  12. }
  13. printf("x=%d\n", x);
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5320KB
stdin
7 
stdout
Input days:x=190