一、偶数和

# -*- coding: UTF-8 -*-
 x=0
 sum=0
 for x in range(0,102,2):
        sum = sum + x print(sum)

二、奇数和

# -*- coding: UTF-8 -*-
 sum = 0
 n = 100
 while n > 0 :
  if n%2==1:
     sum = sum + n
     n=n-1
  else:
   n=n-1
 print(sum)