Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Mar 26, 2024
1 parent 8adf3d8 commit e5ecd1c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lidaskipting2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
n = int(input())
print(n)
print(n // 3 + (1 if n % 3 else 0))
10 changes: 10 additions & 0 deletions src/trapizza.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
d, a, b, h = io.read("*n", "*n", "*n", "*n")
m = math.pi * d * d / 4
t = (a + b) * h / 2
if m == t then
print('Jafn storar!')
elseif m > t then
print('Mahjong!')
else
print('Trapizza!')
end
14 changes: 14 additions & 0 deletions src/trapizza.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from math import pi

d = int(input())
a = int(input())
b = int(input())
h = int(input())
m = pi * d * d / 4
t = (a + b) * h / 2
if m == t:
print("Jafn storar!")
elif m > t:
print("Mahjong!")
else:
print("Trapizza!")

0 comments on commit e5ecd1c

Please sign in to comment.