题目:
代码:
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the breakingRecords function below.
def breakingRecords(scores):
highest_score_count = 0
lowest_score_count = 0
highest = scores[0]
lowest = scores[0]
for i in range(1,len(scores)):
if scores[i] > highest:
highest = scores[i]
highest_score_count += 1
print(highest, ' ')
if scores[i] < lowest:
lowest = scores[i]
lowest_score_count += 1
return highest_score_count, lowest_score_count
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input())
scores = list(map(int, input().rstrip().split()))
result = breakingRecords(scores)
fptr.write(' '.join(map(str, result)))
fptr.write('\n')
fptr.close()
如果觉得不错,就点赞关注留言~
谢谢各位捧场~