ary = gets.chomp array = ary.split("") i = 0 while i < array.length if array[i] == "<" array[i] = ">" elsif array[i] == ">" array[i] = "<" end print array[i] i += 1 end