Guest User

Untitled

a guest
Dec 6th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. $handle = fopen ("php://stdin","r");
  2. fscanf($handle,"%d",$t);
  3. for($a0 = 0; $a0 < $t; $a0++){
  4. fscanf($handle,"%d",$n);
  5. $height = 1;
  6. for ($i=1; $i<=$n; $i++) {
  7. if ($i%2==0) {
  8. $height++;
  9. } else {
  10. $height = $height*2;
  11. }
  12. }
  13. echo $height."\n";
  14. }
Advertisement
Add Comment
Please, Sign In to add comment