Menu
Coddy logo textTech

Bingo

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

In the game of Bingo random numbers from 1 to 90 are chosen. You will have more than 8 numbers every time, and numbers are entered until something out of range isn't given. To calculate the joker, you need the least significant digit of the first 7 numbers and put them next to each other, (the least significant is the rightmost digit), after that add the sum of the remaining numbers and you will get the joker

challenge icon

Challenge

Medium

Write a program that reads natural numbers ranging from 1 to 90 from input until a number out of that range is given. After that calculate the joker and output it

Input
2 32 45 78 64 21 7 65 18 32 88 1 99

Output
2258621

Explanation
The first 7 numbers are 2 32 45 78 64 21 7, we put them together and we get the number 2258417, and to that number, we add the sum of the remaining numbers which is 204 for a total of 2258621

Try it yourself

#include <stdio.h>

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

All lessons in Coding Problems: Volume 2