fork(1) download
  1. //#3
  2. #include <stdio.h>
  3.  
  4. int main(void) {
  5. int a=1,b,z=2,c=2;
  6. scanf("%d\n",&b);
  7. while(a<b){
  8. c=c*3;
  9. a=a+1;
  10. z=z+c;
  11. }
  12. printf("%d\n",z);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5312KB
stdin
3
stdout
26