SHARE
TWEET

Untitled

a guest Jan 11th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main(){
  6.     int t, n;
  7.     scanf("%d",&t);
  8.     for(int a0 = 0; a0 < t; a0++){
  9.         scanf("%d",&n);
  10.         if (n%2==0)
  11.             printf("%d\n", (int) pow(2, ((n/2)+1)) - 1);
  12.         else
  13.             printf("%d\n", (int) (pow(2, ((n-1)/2)+1)-1) * 2);
  14.     }
  15.     return 0;
  16. }
RAW Paste Data
Want to get better at C?
Learn to code C in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top