HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginners > problem:


030. 50341 - Separate Into Digits

Guest
• Review clarifications (1)

Volume problems

• 004. 50350 - Fahrenheit to Celsius
• 005. 50797 - Nr of Missing Guests
• 007. 50280 - Division
• 010. 50357 - Convert Euros into Dol...
• 015. 50356 - Hours Passed
• 020. 50351 - Convert inches to cm
• 025. 50294 - Centimeters to Yards
• 028. 50521 - Pound to Grams
• 030. 50341 - Separate Into Digits
• 034. 50502 - Welcome Andi - 1
• 040. 50879 - Passed or Failed
• 040. Problem 1
• 042. 50798 - Passing the course
• 045. 50391 - Cinema Tickets
• 048. 50403 - Number of Chairs
• 050. 50568 - Body Mass Index Calc...
• 052. 50503 - Welcome Andi - 2

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
bfs.

Separate Into Digits

Write a program that inputs one four-digit number, separates the number into its individual digits. Then, it prints digits separated by a space. And then, it prints the sum of digits in a new line.

Input specification
You will be given an integer number (num) where 1000 ≤ num ≤ 9999

Output specification
Show every digit in order in a line. Then show the sum of digits in the second line.

Sample Input I
  4367
Sample Input II
  5840
Sample Output I
  4 3 6 7
  20
Sample Output II
  5 8 4 0
  17


Для отправки решений необходимо выполнить вход.

www.contester.ru