Call them x and y. Their squares are x^2 and y^2.
x = 2y - 6
x^2 + y^2 = 680 (substitute for x from the first equation.)
(2y - 6)^2 + y^2 = 680
(2y - 6)^2 = 4y^2 - 24y + 36
4y^2 - 24y + 36 + y^2 = 680
5y^2 - 24y - 644 = 0
5 * -644 = -3220
Find two numbers that multiply to -3220 and add to -24
-3220 = -2 * 1610
-2 * 2 * 805
-2 * 2 * 5 * 161
-2 * 2 * 5 * 7 * 23
Any of the numbers can be negative.
-2 * 23 = -46 and 2*5*7 = 70. 70 - 46 = 24
-24 is needed, so 46 and -70
(y -70/5) (y+46/5)
(y -14)(y + 56/4)
The question stated only positive numbers. y-14=0
y = 14
x = 2y - 6 = 2*14 - 6 = 28 - 6 = 22
14^2 + 22^2 = 680 Check
x = 22, y = 14