package com;
import java.util.Scanner;
public class pro7 {
public static void main(String[] args) {
// TODO Auto-generated method stub
/int sum=1;int num=1;
for(int i=2;i<=100;i++)
{
sum = sum +numi;
num=-num;
}
System.out.println(sum);
*/
//1+2+(-1)
int sum = 1;
int num = 1;
for (int i = 2; i <=100; i++) {
sum = sum+num*i;//1+2
num = -num;
}System.out.println("和为:"+sum);
}
}