Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Enter your code here. Read input from STDIN. Print output to STDOUT
- ary = Array.new
- a = gets.chomp
- b= a.to_i
- i = 0
- val = 0
- while i < b do
- ary[i]=gets.chomp
- i+=1
- end
- i = 0
- while i < b
- j = 0
- while j <= ary[i].to_i
- if val % 2 == 0
- val +=1
- else
- val = val*2
- end
- j+=1
- end
- puts(val)
- i+=1
- val = 0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement