您的位置:首页 > 编程语言 > Python开发

用python做oj上的简单题(持续更新中.......)

2014-10-13 11:15 519 查看
本人刚开始接触python,在oj上解一些简单的题,欢迎交流,不喜勿喷.

OJ地址链接:acm.sdut.edu.cn

http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1110&cid=1278

#!/usr/bin/env python
# coding=utf-8

print 'Hello World!'


http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=1000

#!/usr/bin/env python
# coding=utf-8

a=raw_input().split()
print int(a[0])+int(a[1])


http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1111&cid=1278

#!/usr/bin/env python
# coding=utf-8

print '100'
print 'A'
print '3.140000'


http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1117&cid=1279

#!/usr/bin/env python
# coding=utf-8

x = input()
print abs(x)


http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1115&cid=1279

#!/usr/bin/env python
# coding=utf-8

x = raw_input().split()
print x[1],x[0]


http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1208&cid=1279

#!/usr/bin/env python
# coding=utf-8

f = input()
c = 5*(f - 32)/9

print ("%.2f"% c)


http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=1116&cid=1279

#!/usr/bin/env python
# coding=utf-8

import string

x = raw_input()
print x.upper()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: