sum=0 count=0 for i in range(1,101): if (i%2==0): sum+=i count=count+1 print("1到100偶数和为:%d,共有偶数数字%d个"%(sum,count))