คลาส Counter มี value เริ่ม 0 เมธอด inc(self) เพิ่ม 1 และ get(self) คืนค่า — รับจำนวนครั้ง n แล้ว inc n ครั้ง พิมพ์ get()
n ≥ 0
3
3
class Counter:
def __init__(self):
self.value = 0
def inc(self):
self.value += 1
def get(self):
return self.value
c=Counter()
for _ in range(int(input())):
c.inc()
print(c.get()) กด Run เพื่อรันโค้ด หรือ ตรวจคำตอบ เพื่อตรวจ test cases