中国大学MOOC: 下面程序输出结果为:#includeusing namespace std;#includeint main( ){ char st[20]="hello\0\t\\"; cout<
举一反三
- 中国大学MOOC: 下面程序执行后的输出结果是:#include <iostream>using namespace std;void fun(char *c,char d){*c=*c+1; d=d+1;cout<<*c<<","<<d<<",";}int main(){char a=A, b=a;fun(&b,a); cout<<a<<","<<b<<endl;return 0;}
- 运行如下程序,结果为_____。#include <;iostream>;using namespace std;int main( ){int x =10; do { cout <;<; --x ; }while( !x ); return 0;}
- 阅读下面的程序, 请写出程序的输出结果 。 #include<iostream> using namespace std; int main () { enum Color {Red,Green,Blue}; Color color; color=Red; cout<<color<<","; color=Green; cout<<color<<","; color=Blue; cout<<color<<","; cout<<Red+Green+Blue<<endl; return 0; }
- 以下程序的输出结果是 。 #include<iostream> using namespace std; int main() { int num = 50; int& ref = num; ref = ref + 10; cout <<"num = "<<num<<endl; num = num + 40; cout <<"ref = "<<ref<<endl; return 0; }
- 中国大学MOOC: 下面程序执行后的输出结果是:#include <iostream>using namespace std;#include<string.h>int main(){char str[]=" SSWLIA" , c; int k;for (k=2;(c=str[k])!=\0;k++) {switch (c) {case I: ++k; break ;case L: continue;default : cout<<c; continue ;}cout<<*;}return 0;}