您好,本题选C。源代码如下:#include <bits/stdc++.h>using namespace std;int main(){int a,b=6;a=--b;cout<<a<<" "<<b<<endl;return 0;}输出:5 5希望能帮助到您,望采纳,谢谢!
2 个回答
越努力越认真
赞同来自 :
选C
解析:
初始有a未知,b=6
在执行a=--b时,执行右边表达式--b,使得b先-1,再赋值给a
因此a得到了5。
最后语句结束,a和b运行后的值就都为5.
羽逸之光
赞同来自 :
您好,本题选C。源代码如下:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b=6;
a=--b;
cout<<a<<" "<<b<<endl;
return 0;
}
输出:5 5
希望能帮助到您,望采纳,谢谢!
提问者
威望
粉丝
感谢
积分
赞同
提问
文章
回复
私信 问Ta
关注问题人数 3 人
相关问题