Menu
Coddy logo textTech

Numbers

Lesson 11 of 25 in Coddy's Coding Problems: Volume 2 course.

You are given a natural number X, and in each following row, another natural number will be specified until something other than a number is entered. Print out each of those numbers that have the same sum of digits as X

challenge icon

Challenge

Medium

Write a program that reads a natural number from standard input, and then keep inputting integers until something other than an integer is entered. Print out the numbers that satisfy the condition

Input
1234
453
3700
123
6
4321
a

Output
3700
4321

Try it yourself

#include <stdio.h>

int main() {
    // Write code here
    return 0;
}

All lessons in Coding Problems: Volume 2