if("n % 2 == 1")//这个...
#include <stdio.h> int main(){ //用while循环求 1-1/2+1/3-1/4+1/5-1/6+........-1/100 的和 double i=1 ,sum=0; int n=1; do{ if(n%2==1) sum =sum+1/i; else sum =sum-1/i; n++; i++; } while(n <= 100); printf("%lf\n",sum); return 0; }[local]1[/local]