HELLO WORLD--一起加油(🍺)!|

kingwzun

园龄:3年6个月粉丝:111关注:0

7-1 sdut-oop-2 Shift Dot(类和对象)python

class Point:
x=0
y=0
def __init__(self,xx,yy):
self.x=xx
self.y=yy
def move(self,x1,y1):
self.x+=x1
self.y+=y1
def toString(self):
return "({},{})".format(self.x,self.y)
while True:
try:
x,y,n=map(int,input().split())
a=Point(x,y)
for i in range(n):
x1,y1=map(int,input().split())
a.move(x1,y1)
print(a.toString())
except:
break

本文作者:kingwzun

本文链接:https://www.cnblogs.com/kingwz/p/16333291.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   kingwzun  阅读(253)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起