将下列伪代码所描述的算法改写为C语言程序.BEGIN1=>sum2=>deno1=>signwhile denotermsum+term=>sumdemp+1=>deno}print sumEND

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 23:32:06
将下列伪代码所描述的算法改写为C语言程序.BEGIN1=>sum2=>deno1=>signwhile denotermsum+term=>sumdemp+1=>deno}print sumEND
xTN@~cR)p-w[ =4@84&*1bg|ǰ[ (/3~3٘ʙ jjZ g]|4锬N^2紂s + f㬘|Ѕd_Ǝ .yQ}6Hyf283M bCE, gT.Ϻ&/PrZSY*΋J(Ket1G')%~b`xd&lja3 Fd ]6Wo|;%>f^-'|=lFp'q.(ht1a@pW!^gaAuhzրl6om ޴-lլդ{n6;4jkԴ=BFվTaY-FSS2>,

将下列伪代码所描述的算法改写为C语言程序.BEGIN1=>sum2=>deno1=>signwhile denotermsum+term=>sumdemp+1=>deno}print sumEND
将下列伪代码所描述的算法改写为C语言程序.
BEGIN
1=>sum
2=>deno
1=>sign
while denoterm
sum+term=>sum
demp+1=>deno
}
print sum
END

将下列伪代码所描述的算法改写为C语言程序.BEGIN1=>sum2=>deno1=>signwhile denotermsum+term=>sumdemp+1=>deno}print sumEND
#include <stdio.h>

void main( void )
{
    int sum = 1;
    int deno = 2;
    int sign = 1;
    
    while( deno <= 100 )
    {
        term = -1 * 1 / deno;
        sum = sum + term;
        deno = deno + 1;
    }
    
    printf( "%d", sum );
}
楼主,你如果没有编译器,代码给你了,又有什么意义