解题思路:
注意事项:
参考代码:
from datetime import datetime,timedelta
n=input()
a=int(n[:4])
b=int(n[4]+n[5])
c=int(n[6]+n[7])
day=datetime(a,b,c)
delta=timedelta(1)
day+=delta
d=['' for _ in range(8)]
while 1:
d[0:4]=str(day.year)
if(day.month<10):
d[4:6]='0'+str(day.month)
else:
d[4:6]=str(day.month)
if(day.day<10):
d[6:8]='0'+str(day.day)
else:
d[6:8]=str(day.day)
if(d==d[::-1]):
print(''.join(d))
break
day+=delta
b=int(n)
c=[10100101,20200202,21211212,30300303,40400404,50500505,60600606,70700707,80800808,90900909]#01011010不符合数据限制 打表
for i in range(len(c)):
if(b<c[i]):
print(c[i])
break
if(b==i):
print(c[i+1])
break
0.0分
0 人评分
C语言训练-角谷猜想 (C语言代码)浏览:1768 |
数组输出 (C语言代码)--此题的题目描述有问题浏览:1844 |
C语言程序设计教程(第三版)课后习题1.5 (C++代码)浏览:1114 |
DNA (C语言描述,数据结构)浏览:909 |
A+B for Input-Output Practice (VII) (C语言代码)浏览:566 |
DNA (C语言代码)浏览:440 |
printf基础练习2 (C语言代码)浏览:547 |
C语言程序设计教程(第三版)课后习题9.3 (C语言代码)浏览:650 |
C二级辅导-统计字符 (C语言代码)浏览:514 |
淘淘的名单 (C语言代码)浏览:1309 |