单项选择题
有以下程序
#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,
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下类定义 class Point public: Pointint x = 0, int y=0) _x = x; _y = y; void Move int xoff, int yoff) _x +=xoff;_y+=yoff; void Print() const cout<<’(’<<_x<<’,’<<_y<<’)’ << end1; private: int_x,_y; ; 下列语句中会发生编译错误的是
A.Point pt;pt.Print();
B.const Point pt;pt.Print();
C.Point pt;pt.Move(1, 2);
D.const Point pt;pt.Move(1, 2)
点击查看答案&解析
单项选择题
下列程序的输出结果是 #include <iostream> using namespace std; int main () char a[] = Hello,World : char*ptr = a; while (*ptr) if(*ptr>= ’a’ &&*ptr <=’z’ cout<<char*ptr+’A’-’a’); else cout<<*ptr; ptr++; return 0;
A.HELLO. WORLD
B.Hello, World
C.hELLO, wORLD
D.hello, world
点击查看答案&解析
相关试题
有以下程序: #include <iostream> u...
有如下程序: #include <iostream.h>...