网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下列VisualBasic程序段运行后,变量s、t的值为()。s=0:t=1Fork=2To4s=s+kt=t*kNextk
A.22
B.924
C.56
D.01
参考答案
更多 “ 下列VisualBasic程序段运行后,变量s、t的值为()。s=0:t=1Fork=2To4s=s+kt=t*kNextkA.22B.924C.56D.01 ” 相关考题
考题
以下与库函数strcmp(char *s, chat *t)的功能相等的程序段是()。
A.strcmp1(char *s, chat *t){ for ( ;*s++==*t++ ;)if (*s=='\0') return 0return (*s-*t)}B.strcmp2(char *s, char *t){ for( ;*s++==*t++ ;)if (!*s) return0return (*s-*t)C.strcmp3(char *s, char *t){ for ( ;*t==*s ;){ if (!*t) return 0t++s++}return (*s-*t)}D.strcmp4(char *s, char *t){ for( ;*s==*t;s++,t++)if (!*s) return 0return (*t-*s)}
考题
执行下列程序段后,串X的值为( )。S=〞abcdefgh〞; T=〞xyzw〞;substr (X,S,2,strlen(T));substr (Y,S, stelen(T),2);strcat (X,Y);
A. 〞cdefgh〞B. 〞cdxyzw〞C. 〞cdefxy〞D. 〞cdefef〞
考题
有下列程序段: int n,t=1,s=0; scanf("%d",n); do{s=s+t;t=t-2;}while(t!=n); 为使此程序段不陷入死循环,从键盘输入的数据应该是( )。A.4,4B.2,2C.4,5D.2,4
考题
若下列程序执行后t的值为4,则执行时输入a,b的值范围是 #include ”stdio.h” main() { int a, b, s=1, t=1; scanf (”%d, %d”, a, b); if (a>0) s+=1; if (a>b) t+=s; else if(a==b) t=5; else t = 2*s; printf (”s=%d, t=%dn”, s,t); }
考题
下列各语句序列中,能够将变量u和s中的较大值赋值到变量t中的是()。A.if(u>s)t=u ; t=s;B.t=s ; if(u>s)t=u;C.if(u>s)t=s ; else t=u;D.t=u ; if(u>s)t=s;
考题
程序填空计算出s=1-3+5-7…-99+101的值。 #include <stdio.h> int main() { int i,t=1,s=0; /* t为中间变量 */ for (i=1;i<=101;i+=2) { t=t*i; s=s+t; ______________ /*正1,负1交叉*/ } printf(″%dn″,s); return 0; }
考题
3、若下列程序执行后t的值为4,则执行时输入a,b的值范围是 #include ”stdio.h” main() { int a, b, s=1, t=1; scanf (”%d, %d”, a, b); if (a>0) s+=1; if (a>b) t+=s; else if(a==b) t=5; else t = 2*s; printf (”s=%d, t=%d\n”, s,t); }
热门标签
最新试卷