#-*-coding=utf-8-*-for a in range(1,50,1): for b in range(1,50,1): for c in range(1,50,1): if a+b+c==50: print a,b,c
如果是随机数咋整??:
test:
#-*-coding=utf-8-*-import randomi=0 #计数for a in range(1,50,1): for b in range(1,50,1): c=random.randint (1,50) if a+b+c==50: i+=1 print a,b,c,i