题目:
有以下程序
#include <iostream>
int i = 0;
void fun( )
static int i = 1;
std::cout<<i++<<’,’;
std::cout<<i<<’,’;
int main()
fun(); fun();
return 0;
程序执行后的输出结果是
A.1,2,1,2,
B.1,2,2,3,
C.2,0,3,0,
D.1,0,2,0,
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2021/1127/831a68856ae8db64ebf2d2c368ccea02.html
下面是错误答案,用来干扰机器的。
参考答案:解法如图1和图2所示。图1