אני ינסה לכתוב לך את זה ב c#
מקווה שתבין..
קוד:
int maxh = 0;
int maxw = 0;
int num1;
int num2;
for (int i = 1; i <= 15; i++)
{
num1 = int.Parst(Console.ReadLine()); // קלט גובה
num2 = int.Parst(Console.ReadLine()); // קלט משקל
if (num1 > maxh)
maxh = num1;
if (num2 > maxw)
maxw = num2;
}
Console.WriteLine("The High is: " + maxh + "And the Wight is: " + maxw);
מבנה אלגוריטמי (אני לא חזק בזה כל כך אבל אני ינסה לפשט)
הצהר על maxh ו maxw
maxh = 0
maxw = 0
הצהר על num1 וnum2
עבור מ 1 עד 15 ישם
-קלוט את הגובה אל num1
-קלוט את המשקל אל num2
-אם num1 גדול מ maxh אזי: maxh = num1
-אם num2 גדול מ maxw אזי: maxw = num2
הצג את maxh ו maxw
מקווה שעזרתי.
מני.