main()
{int num[2],i,j=0;
for(i=0;i<2;printf("\nInput num%d:",i+1),scanf("%d",&num[i]));
for(i=(num[0]<num[1]?num[0]:num[1])+1;i++<(num[0]>num[1]?num[0]:num[1]);)
if(i%2==1)j+=i;
printf("sum=%d",j);
}
没测试过,
[此贴子已经被作者于2005-6-29 8:50:08编辑过]