DevJourney · code I wrote while learning

README.md

Tech Numbers

Single File Programming Question

Problem Statement

Riya is analyzing a list of numbers to identify tech numbers. A tech number is a number with an even number of digits that can be split into two equal halves, such that the square of the sum of these two halves is equal to the original number.

For example, 2025 is a tech number because:

20 + 25 = 45, and 45² = 2025.

Write a program that reads n integers from the user and saves them in a file named numbers.txt. The program should then read the numbers from this file, identify all tech numbers, and write the results to results.txt.

If no tech numbers are found, write "Empty" to the output file and also print the same to the console.

Input:

format :

First line: An integer n, the count of numbers.

Second line: n space-separated integers.

Output:

format :

If tech numbers are found: Write them space-separated in results.txt and print them on the console.

If no tech numbers are found: Write and print Empty.

Refer to the sample output for formatting specifications.

Code constraints : 1 ≤ n ≤ 15

Sample test cases :

Input 1:

5
2025 3025 9801 1234 5678
Output 1 :
2025 3025 9801
Input 2 :
3
123 456 789
Output 2 :
Empty
Note :
The program will be evaluated only after the “Submit Code” is clicked.
Extra spaces and new line characters in the program output will result in the failure of the test case.
Marks : 10
Negative Marks : 0