Skip to content

Commit c597857

Browse files
committed
finish 2022/04/*
1 parent 873602b commit c597857

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

2022/04/1.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
count = 0
2-
t = 0
32

43
for line in open("data.txt"):
54
pair = line.split(",")

2022/04/2.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
count = 0
2+
3+
for line in open("data.txt"):
4+
pair = line.split(",")
5+
#print(pair)
6+
7+
a, b = map(int, pair[0].split("-"))
8+
x, y = map(int, pair[1].split("-"))
9+
10+
if a >= x and a <= y or b >= x and b <= y or x >= a and x <= b or y >= a and y <= b:
11+
count += 1
12+
13+
# print(line, a, b, x, y, count)
14+
15+
16+
print(count)

0 commit comments

Comments
 (0)