若运行输入:3<回车>,则以下程序的输出结果是( )。 main() {int a,b; scanf("%d",&A); b=(a>=0)?a:-a; printf("b=%d",B); }
第1题:
已知字符A的ASCII代码值为65,以下程序运行时,若从键盘输入:B33<回车>。则输出结果是______。 #include "stdio.h" main() { char a,b; a=getchar();scanf("Xd",&b); a=a-'A'+'0';b=b*2; printf("%c%c\n",a,b); }
A.2 B
B.1 B
C.3 B
D.4 B
第2题:
以下程序运行后输入:3,abcde<回车>,则输出结果是【 】
include <string.h>
move(char *str, int n)
{ char temp; int i;
temp=str[n-1];
for(i=n-1;i>0;i--) str[i]=str[i-1];
str[0]=temp;
}
main( )
{ char s[50]; int n, i, z;
scanf("%d,%s",&n,s);
z=strlen(s);
for(i=1; i<=n; i++) move(s, z);
printf("%s\n",s);
}
第3题:
已知字符A的ASCII代码值为65,以下程序运行时若从键盘输入:B33<回车>,则输出结果是________。 main() { char a,b; a=getchar();scanf("%d",&b); b=b*2; printf("%cn",b); }
第4题:
有以下程序:
int sub(int n) { return(n/10+n%10); }
main()
{ int x, y;
scanf("% d", &x);
y=sub(sub(sub(x)));
printf("% d\n", y);
}
若运行时输入:1234<回车>,程序的输出结果是【 】。
第5题:
已知字符A的ASCⅡ代码值为65,以下程序运行时若从键盘输入:B33<回车>.则输出结果是( )。
include
main()
{ char a,b;
a=getchar();scanf("%d",&B);
a=a-'A'+'0';b=b*2;
printf("%c%c\n",a,B);
}