编写程序,求1-3+5-7……-99+101的值 谢谢
编写程序,求1-3+5-7……-99+101的值 谢谢
日期:2017-09-22 09:41:06 人气:1
#include
main()
{
int i,j,k=0,p=0,temp;
for(i=1;i<=101;i=i+4)
k+=i;
for(j=3;j<100;j=j+4)
p+=j;
temp=k-p;
printf("%d",temp);
}
编写程序,求1-3+5-7……-99+101的值 谢谢