当执行下面程序段后,变量S的值是? s=0 c=1 for i=1 to 10 c=c*-1 s=s+c*i next i print s

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 15:03:38
当执行下面程序段后,变量S的值是? s=0 c=1 for i=1 to 10 c=c*-1 s=s+c*i next i print s
x){w/iÞg3+($*)d|CH!PX;Y+S!/D!S(3D&H7:&>+,Q/(MLVHI,.VI-.QF/.I,Re) y%@ҋc5+KRsKKvi($)iZf0IVU0pAfiĀZ+d$فT

当执行下面程序段后,变量S的值是? s=0 c=1 for i=1 to 10 c=c*-1 s=s+c*i next i print s
当执行下面程序段后,变量S的值是? s=0 c=1 for i=1 to 10 c=c*-1 s=s+c*i next i print s

当执行下面程序段后,变量S的值是? s=0 c=1 for i=1 to 10 c=c*-1 s=s+c*i next i print s
我用Java
public class Test {
public static void main(String args[]) {
System.out.println("Start...");
// s=0 c=1 for i=1 to 10 c=c*-1 s=s+c*i next i print s
int s=0;
int c = 1;
for (int i=1; i