题目
阅读下面的程序,该程序().
main()
{ int a=5,b=0,c=0;
if(a=b+c) printf("***/n");
else printf("$$$/n"); }
A、可以通过编译但不能通过连接
B、输出***
C、输出$$$
D、有语法错不能通过编译
第4题
第5题
第7题
●试题二
阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。
【说明】
该程序运行后,输出下面的数字金字塔
【程序】
include<stdio.h>
main ()
{char max,next;
int i;
for(max=′1′;max<=′9′;max++)
{for(i=1;i<=20- (1) ;++i)
printf(" ");
for(next= (2) ;next<= (3) ;next++)
printf("%c",next);
for(next= (4) ;next>= (5) ;next--)
printf("%c",next);
printf("\n");
}
}
第8题
阅读下面的程序: #include<iostream.h> void main() { int x; cin>>x; if(x++>5) cout<<x<<endl; else cout<<x——<<endl; } 如果两次执行上述程序,且键盘输入分别为4和6,则输出结果分别是()。
A.4,6
B.3,6
C.4,7
D.5,7
第9题
第10题
阅读下面的程序段: publiC class Sun { public static void main (String args[ ]) { int a=0; for(int i=1;i<=3;i++) { for(int j=1;j<=i;j++) { for(int k=j;k<=3;k++) { a=a+1; } } } System.out.println(A) ; } } 执行上面的3重循环后,a的值为()。
A.3
B.9
C.14
D.21
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!