Programming contests

50 Programming Exercise for Beginners

January 2, 2019 12:00 AM – December 31, 2019 12:00 AM

Palindromes

Write a program that reads strings of up to 29 characters from the standard input, one per line, until the scanned string is a palindromic string. Palindromes have the same characters in the same order when read backwards as if read forwards. With the exception of the last string scanned, the program should write to the standard output each string and its length, separated by a space character.

Sample Input

  1. alma
  2. eper retek cseresznye
  3. ribizli
  4. komor romok
download as text file

Output for Sample Input

  1. alma 4
  2. eper retek cseresznye 21
  3. ribizli 7
download as text file

One possible solution is available in: main.c.

Acknowledgement This work was supported by the construction EFOP-3.4.3-16-2016-00021. The project was supported by the European Union, co-financed by the European Social Fund.
University of Debrecen; Faculty of Informatics; v. 03/01/2019