#includemain(){ int a,b,c,d=1,f;printf("请依次输入等差数列的首项、公差、项数:");scanf("%d%d%d",&a,&b,&c);f=a;while(d{a+=b;f+=a;d+=1;}printf("%d",f);//7=10-3,17=10+7//0=0+1}