网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

设a,s为int型变量,则下面循环语句执行后s的值? a=123321,s=0; while(a!=s) { s=s*10+a % 10; a/=10; } printf("%dn",s);

A.0

B.123

C.123321

D.死循环


参考答案和解析
C
更多 “设a,s为int型变量,则下面循环语句执行后s的值? a=123321,s=0; while(a!=s) { s=s*10+a % 10; a/=10; } printf("%dn",s);A.0B.123C.123321D.死循环” 相关考题
考题 有以下程序include stdio.hint fun(char s[]){ int n=0;while(*s='9'stdio.hint fun(char s[]){ int n=0;while(*s='9'*s='0') {n=10*n+*s-'0';s++;}return(n);}main(){ char s[10]={ '6', '1', '*', '4', '*', '9', '*', '0', '*'};printf("%d\n",fun(s));}程序运行的结果是A ) 9B ) 61490C ) 61D ) 5

考题 以下程序运行后的输出结果是【 9 】#include stdio.hmain(){ int k=1,s=0;do{if((k%2)!=0) continue;s+=k;k++;}while(k10);printf("s=%d\n",s);}

考题 执行下面的程序段后,变量k中的值为int k=3, s[2];s[0]=k; k=s[1]*10;A.不定值B.33C.30D.10

考题 执行下面的程序段后,变量k的值为( )。 int k=3,s[2]; s[0]=k; k=s[1]*10;A.不定值B.33C.30D.10

考题 执行下面的程序段后,s的值为【 】。s = 0:k = 10While ks=s+10k=k-2Wend

考题 在下面循环语句中循环体执行的次数为( )。int i=0,s=0; while(s 在下面循环语句中循环体执行的次数为( )。int i=0,s=0; while(sA、4B、5C、6D、7

考题 下列程序执行后,变量s的值为______。 Dim s As long ,x As Integer s=0:x=1 Do While (x A. 10B. 25C. 50D. 100

考题 执行下面的程序段,s的值为 【 】 。s=0:k=10While ks=s+10k=k-2Wend

考题 已知C源程序如下: include include void reverse(char S[]){ int C,i,J; f 已知C源程序如下:include<stdio. h>include<string. h>void reverse(char S[]){int C,i,J;for(i=0,j=strlen(s)-1;i<j;i++,j++){c=s[i];s[i]=s[j];s[j]=c;}}void getHex(int number,char s[]){int I;i=0;while(number>0){if(number%16<10)s[i++]=number%16+'0';elseswitch(number%16){case 10:s[i++]='A';break;case 11:s[i++]='B';break;case 12:s[i++]='C';break;case 13:s[i++]='D';break;case 14:s[i++]='E';break;case 15:s[i++]='F';break;default:printf("Error");break;}number/=16;}s[i]:'\o';reverse(s);}int main(){unsigned int number;int i=0:char s[50];printf("%s","please input number;\n");scanf("%d",&number):getHex(number,s);i=0;while(s[i])printf("%c",s[i++]);return 0;}画出程序中所有函数的控制流程图。

考题 有以下程序 include int fun(char s[]) { int n=O; whil 有以下程序 #include <stdio.h> int fun(char s[]) { int n=O; while(*s<='9'*s>='0') { n=10*n+*s-'0'; s++; } return (n); } main() { char s[10]={ '6', '1', '*', '4', '*', '9', '*', '0', '*'}; printf("%d\n",fun(s)); }A.9B.61490C.61D.5

考题 有以下程序: int a=2; int f(int *a) {return (*a)++;) main() { int s=0; { int a=5; s+=f(a); } s+=f(a); printf("%d\n',s); } 执行后输出结果是( )。A.10B.9C.7D.8

考题 有以下程序includeintfun(chars[]){intn=0;while(*s='0'){n=10*n+* 有以下程序 #include <stdio.h> int fun(char s[]) { int n=0; while(*s<='9'*s>='0') {n=10*n+*s-'0';s++;} return(n); } main() {char s[10]={'6','1','*','4','*','9','*','0','*'}; printf("%d\n",fun(s)); } 程序的运行结果是A.9B.61490C.61D.5

考题 下列程序的运行结果是______。main(){ int s=0,i=1;while(s<= 10){ s=s+i*i;i++;}printf("%d",-i);}

考题 下面程序的运行结果是( )。 include main() {int a,s,n,m; a=2;s=0;n=1;m=1; while(m 下面程序的运行结果是( )。 include<stdio.h> main() {int a,s,n,m; a=2;s=0;n=1;m=1; while(m<=4){n=n*a;s=s+n;++m;} printf("s=%d",s); }

考题 阅读下面程序,则执行后的输出结果为#includestdio.hfun(int a,int b){int s;s=a*b/2;printf(%d\n,s);}main(){int a=10,b=16;fun(a,b);}A.10B.16C.160D.80

考题 有以下程序 #includestdio.h int fun(char s[]) {int n=0; while(*s=9&&*s=0){n=10*n+*s-o;s++;) return(n); } main {char s[10]={6,1,*,4,*,9,*, 0,*); printf("%d",fun(s)); } 程序运行的结果是( )。A.9B.61490C.61D.5

考题 下列程序执行后,变量S的值为______ 。 Dim s As Long,X As Integer s=0 X=1 Do While x<10 s= s+ x x=x+2 Loop Print sA. 10B.25C.50D.100

考题 有下列程序: includestdi0.hvoidfun(char*s){while(*s){if(*s%2==(1)printf(%Cstdi0.hvoidfun(char*s){while(*s){if(*s%2==(1)printf(%C,*s);s+十:}}voidmain( ){chara[]={good);fun(a);printf(n);}注意:字母a的ASCIl码值为97,程序运行后的输出结果是( )。A.dB.goC.godD.good

考题 有以下程序 include int fun(char s[ ]) { int n=0; while(*s='0 有以下程序#include <stdio.h>int fun(char s[ ]){ int n=0;while(*s<='9'*s>='0') {n=10*n+*s-'0';s++;}retum(n);}main( ){ char s[10]={'6','1','*','4','*','9','*','0','*'};printf("%d\n",fun(s));}程序的运行结果是A.9B.61490C.61D.5

考题 以下语句的执行结果是( )。 int m=0,s=1; do { s+ = m++; } while (m6); printf("%d\n",s);A.17B.16C.15D.18

考题 执行下面的程序段后,变量k中的值为 include void main( ) { int k=3,s[2]; s[ 执行下面的程序段后,变量k中的值为 #include<iostream.h> void main( ) { int k=3, s[2]; s[0]=k; k=s[1] *10; cout < < k;}A.不定值B.33C.30D.10

考题 有以下程序:includeint fun(char s[]){ intn=0;while(*s='0'){n=10 有以下程序: #include <stdio.h> int fun(char s[]) { int n=0; while(*s<='9'*s>='0') {n=10*n+*s-'0';s++;} return(n); } main() { char s[10]={'6','1','*','4','*','9','*','0','*'}; printf("%d\n",fun(s)); } 程序的运行结果是( )。A.9B.61490C.61D.5

考题 有以下程序 includestdio.hintfun(chars[]){intn=0;while(*s=’9’stdio.hint fun(char s[]){int n=0;while(*s=’9’*s=’0’) { n=10*n+*s-‘0’;s++; }return(n);}main(){char s[10]={‘6’,’1’,’*’,’4’,’*’,’9’,’*’,’0’,’*’};printf(“%d\n”,fun(s));}程序的运行结果是( )。A.9B.61490C.61D.5

考题 int i=0,s=0;while(s20){i++;s+=i;}在这个的while循环语句中,其循环体被执行的次数为()。A4B5C6D7

考题 若s是int型变量,且s=6,则下面表达式的值是() s%2+(s+1)%2

考题 单选题执行下面的程序段后,变量k中的值为() int k=3,s[2]; s[0]=k; k=s[1]*10;A 不定值B 33C 30D 10

考题 单选题int i=0,s=0;while(s20){i++;s+=i;}在这个的while循环语句中,其循环体被执行的次数为()。A 4B 5C 6D 7

考题 单选题有以下程序#include int fun(char s[]){ int n=0; while(*s='0') {  n=10*n+*s-'0';  s++; } return (n);}main(){ char s[10]={'6','1','*','4','*','9','*','0','*'}; printf("%d",fun(s));}程序的运行结果是(  )。A 61490B 61C 9D 5