Problème
Return the largest of three integers. Practice comparisons with if statements; don't use a built-in max function.
Implement largest_of_three(a, b, c).
Input
a: The first number. b: The second number. c: The third number.
Output
Return the largest value.
Contraintes
-1,000,000,000 ≤ a, b, c ≤ 1,000,000,000
Exemples
Entrée :
a = 3
b = 9
c = 4
Sortie attendue :
expected = 9
Entrée :
long long a = 3;
long long b = 9;
long long c = 4;
Sortie attendue :
long long expected = 9;
Entrée :
long a = 3;
long b = 9;
long c = 4;
Sortie attendue :
long expected = 9;
Explication
9 is greater than both 3 and 4.
Entrée :
a = -5
b = -2
c = -2
Sortie attendue :
expected = -2
Entrée :
long long a = -5;
long long b = -2;
long long c = -2;
Sortie attendue :
long long expected = -2;
Entrée :
long a = -5;
long b = -2;
long c = -2;
Sortie attendue :
long expected = -2;
Explication
-2 appears twice and is the largest value.
Références
Ce défi a été adapté pour CodeUtility. Suivez l'énoncé et les contraintes ci-dessus.