revert.alc 391 B

12345678910111213141516171819202122
  1. include "primitives.alh"
  2. String function revert_string(a : String):
  3. Integer length
  4. length = string_len(a)
  5. Integer counter
  6. counter = 0
  7. String result
  8. result = ""
  9. while (integer_lt(counter, length)):
  10. result = string_join(string_get(a, counter), result)
  11. counter = integer_addition(counter, 1)
  12. return result
  13. Void function main():
  14. while (True):
  15. output(revert_string(input()))