山东理工大学SDUT - ACM OJ 题: Python代码 及分析
Python基础语法学习完成,先刷基础题100道巩固 ,附 题目、代码、知识分析 题目:http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/1000.html 代码: s = input().split(); print((int)(s[0])+(int)(s[1])) 知识分析: 1、python输入 input() 2、split() 是分割字符串操作 3、python可以用str[0] 取字符串下标为0的字符 1000、A+B Problem 题目:http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/1010.html 代码: while True: s=input().split() print((int)(s[0])+(int)(s[1])) 分析知识: 1、Python的布尔类型有 True False 记住是大写 2、while True : 后面冒号必须有 括号不一定需要有...