C语言学习之求1-1/2+1/3-1/4+···+1/99-1/100 #include <stdio.h> int main(){ int a=1;//定义+,-的变量 double x,y,sum;//定义循环控制变量,求和变量 x=2.0