online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import os def get_angle_range(angles,acc=10): """ 获取角度范围 """ angles += [i+360 for i in angles] angles = sorted(angles) # 初始化起始角度 res = [angles[0]] for i in range(len(angles)-1): if angles[i+1] - angles[i] >acc: res.append(angles[i]) res.append(angles[i+1]) assert len(res)==5 or len(res)==3,print("识别有错误") if len(res)==5: return res[2:4] else: return res[:2] if __name__=="__main__": case1 = list(range(0, 90,5)) + list(range(270, 360,5)) # 0-90 270-360 连续的角度:270-450 print(get_angle_range(case1,acc=10)) case2 = list(range(90, 270,5)) # 90-270 连续的角度:90-270 print(get_angle_range(case2,acc=10))

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue