public class cpdd{
public static void main(String[] args){
int i=1;
int sum=0;
int sum1=0; //偶数的和
int sum2=2; //奇数的差,初始值为2.使得减去1之后仍为1.
for(i=1;i<=100;i++){
if(i%2==0){
sum1+=i;
} else if(i%2!=0){
sum2-=i;
}
}sum = sum1+sum2;
System.out.println(sum);
}
}