Question
Find the whole square roots Your solution will be scored against some number of hidden test cases. A sample is provided below. The following is
"Find the whole square roots"
Your solution will be scored against some number of hidden test cases. A sample is provided below.
The following is a simple problem which will test your ability to work with numbers and lists.
Given the list of whole positive integers, create a list of all integers which have a whole number square root.
Print the length of the list and print the last item in the list.
For example:
9 has a whole number square root ... 3
5 does not have a whole number square root ... 2.2360
Input
Input consists of N lines of one number each.
All number are positive whole numbers. There are no decimals or fractions.
There will always be at least one number in the list.
Output
Print the count of numbers from the input which have a whole number square root on the first line.
Print the last number in the list with a whole number square root on the second line (see example below).
If no numbers with a whole number square root are found, only print the first line.
Code evaluation based on output, please do NOT output anything else.
Sample Input
10
9
151
16
8
output
2
16
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started