# 17-11-10

``````#include<stdio.h>
int main()
{
int i=1;
int sum=0;
do
{
sum=sum+i;
i++;
}while(i<=100);
printf("1+...+%d=%d\n",i-1,sum);
return 0;
}
``````

``````#include<stdio.h>

int main()
{
int i=1;
int sum=0;
do
{
sum=sum+i;
i=i+2;
}while(i<=100);
printf("1+3+...+%d=%d\n",i-2,sum);
return 0;
}
``````

``````#include<stdio.h>

int main()
{
int i=0;
int sum=0;
do
{
sum=sum+i;
i=i+2;
}while(i<=100);
printf("2+4+...+%d=%d\n",i-2,sum);
return 0;
}
``````

``````#include<stdio.h>

int main()
{
int a=0;
int b=0;
int sum=0;
double i=0;
do
{
printf("请输入一个整数：");
scanf("%d",&a);
printf("是否继续?yes->1 no->0");
scanf("%d",&b);
sum=sum+a;
i=i+1;
}while(b!=0);
printf("输入数值的总和为：%d,其平均值为：%lf",sum,sum/i);
return 0;

}
``````

``````#include<stdio.h>

int main()
{
int a=0;
int b=0;
int i=0;
int sum=0;
printf("请输入整数a:");
scanf("%d",&a);
printf("请输入整数b:");
scanf("%d",&b);
i=i+a;
do
{
sum=sum+a;
a++;
}while(a<=b);
printf("大于等于%d小于等于%d的整数之和为：%d",i,b,sum);
return 0;
}
``````

``````#include<stdio.h>

int main()
{
int a=0;
int b=0;
int i=0;
int sum=0;
printf("请输入整数a:");
scanf("%d",&a);
printf("请输入整数b:");
scanf("%d",&b);
i=i+b;
do
{
sum=sum+b;
b++;
}while(b<=a);
printf("大于等于%d小于等于%d的整数之和为：%d",i,a,sum);
return 0;
}
``````
10.30