#include <stdio.h>int main(){ int i,a,b; while(scanf("%d%d",&a,&b)!=EOF){ if(a%2==1){ a++; } if(b%2==1){ b--; } i=((b-a)/2+1)*(a+b)/2; printf("%d\n",i); } return 0;}
根本不需要loop啊
#include int main(){ int i,a,b; while(scanf("%d%d",&a,&b)!=EOF){ if(a%2==1){ a++; } if(b%2==1){ b--; } i=((b-a)/2+1)*(a+b)/2; printf("%d\n",i); } return 0;}
等差數列啊