Largest Tenth Digit Integer

65
0

The program must accept three integers X, Y and Z as the input. The program must print the value having the largest tenth digit as the output. If multiple values have the largest tenth digit, then the program must print the largest value among them as the output.

Boundary Condition(s):
10 X, Y, Z <= 10^8

Input Format:
The first line contains the value of X, Y and Z separated by spaces(s).

Output Format:

The first line contains the largest value based on the given conditions.

Example Input/Output 1:
Input
520 100 210

Output
520
Explanation:
The tenth digits are 2, 0 and 1. The largest of them is 2.
Hence 520 is printed.

Example Input/Output 2
Input
862 62 332
Output
862

a=list(map(int, input().split()))
l=0
n=0
for i in a: 
	m=(i%100)//10
	if(l<m): 
		l=m
		n=i
	elif(l==m):	
		if(n<i):
			n=i
print(n)
Hephzibai
WRITTEN BY

Hephzibai

Hephzibai is a driven third-year student at St. Joseph's Institute of Technology, specializing in Computer Science and Engineering. With a keen interest in data science and also in fullstack.
One of my greatest strengths lies in my programming skills, which I've honed through countless hours of practice and participation in coding challenges. Platforms like Skillrack, HackerRank, and others have been my playgrounds, where I've tackled a wide range of problems with creativity and determination.

Leave a Reply

Your email address will not be published. Required fields are marked *