Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Dec 11, 2023
1 parent dc7e5ae commit 415a639
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/aaah.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
a, b = io.read(), io.read()
_, na = a:gsub("a", "")
_, nb = b:gsub("a", "")
if na >= nb then
print("go")
else
print("no")
end
30 changes: 30 additions & 0 deletions src/astrologicalsign.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
for _ = 1, io.read("*n") do
d = io.read("*n")
m = io.read():gsub("%s+", "")

if (m == "Mar" and d >= 21) or (m == "Apr" and d <= 20) then
print("Aries")
elseif (m == "Apr" and d >= 21) or (m == "May" and d <= 20) then
print("Taurus")
elseif (m == "May" and d >= 21) or (m == "Jun" and d <= 21) then
print("Gemini")
elseif (m == "Jun" and d >= 22) or (m == "Jul" and d <= 22) then
print("Cancer")
elseif (m == "Jul" and d >= 23) or (m == "Aug" and d <= 22) then
print("Leo")
elseif (m == "Aug" and d >= 23) or (m == "Sep" and d <= 21) then
print("Virgo")
elseif (m == "Sep" and d >= 22) or (m == "Oct" and d <= 22) then
print("Libra")
elseif (m == "Oct" and d >= 23) or (m == "Nov" and d <= 22) then
print("Scorpio")
elseif (m == "Nov" and d >= 23) or (m == "Dec" and d <= 21) then
print("Sagittarius")
elseif (m == "Dec" and d >= 22) or (m == "Jan" and d <= 20) then
print("Capricorn")
elseif (m == "Jan" and d >= 21) or (m == "Feb" and d <= 19) then
print("Aquarius")
elseif (m == "Feb" and d >= 20) or (m == "Mar" and d <= 20) then
print("Pisces")
end
end
12 changes: 12 additions & 0 deletions src/cookingwater.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
n = io.read("*n")
lb, ub = 0, 1000
for _ = 1, n do
a, b = io.read("*n", "*n")
lb = math.max(lb, a)
ub = math.min(ub, b)
end
if lb > ub then
print("edward is right")
else
print("gunilla has a point")
end
9 changes: 9 additions & 0 deletions src/meddelande.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
n, m = [int(d) for d in input().split()]
cells = []
for _ in range(n):
cells.append(input())
message = ""
for j in range(m):
for i in range(n):
message += cells[i][j] if cells[i][j] != "." else ""
print(message)

0 comments on commit 415a639

Please sign in to comment.