-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproblem91.aarr
41 lines (40 loc) · 879 Bytes
/
problem91.aarr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
total = 0
loop x1 = 0 | x1 < 51 | x1 ++ |
loop y1 = 0 | y1 < 51 | y1 ++ |
loop x2 = 0 | x2 < 51 | x2 ++ |
loop y2 = 0 | y2 < 51 | y2 ++ |
okay = true
if ( x1 == x2 )
if ( y1 == y2 )
okay = false
}
}
if ( x1 == 0 )
if ( y1 == 0 )
okay = false
}
}
if ( x2 == 0 )
if ( y2 == 0 )
okay = false
}
}
if ( okay )
a = ( ( x1 * x1 ) + ( y1 * y1 ) )
b = ( ( x2 * x2 ) + ( y2 * y2 ) )
c = ( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) )
if ( a + b == c )
total ++
}
if ( b + c == a )
total ++
}
if ( c + a == b )
total ++
}
}
}
}
}
}
print ( total / 2 )