Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('input.txt', 'r') as InputFile:
- a, b = InputFile.read().split()
- a = int(a); b=int(b)
- max = 1
- i = 1
- while(b!=0):
- if(a==b):
- i+=1
- elif(a!=b):
- if(i>max):
- max=i
- i=1
- else:
- i=1
- a=b
- b = InputFile.read()
- if(max>i):
- with open('output.txt', 'w') as OutputFile:
- OutputFile.write(str(max))
- else:
- with open('output.txt', 'w') as OutputFile:
- OutputFile.write(str(i))
Advertisement
Add Comment
Please, Sign In to add comment