题目
[主观题]
【填空题】分析下列程序并写出程序结果。 #include <iostream> using namespace std; enum Season { spring, summer=100, fall=96, winter }; typedef enum { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } Weekday; void main____ { /* Season */ cout<<spring<<endl; // 0 cout<<summer<<","<<summer<<endl; // 100, d cout<<fall+winter<<endl; // 193 Season mySeason=winter; if____ cout<<"mySeason is winter "
答案
更多“【填空题】分析下列程序并写出程序结果。 #include <iostream> using namespace std; enum Season { spring, summer=100, fall=…”相关的问题
第1题
【填空题】阅读下列程序,写出程序的运行结果____。 #include <iostream> using namespace std; class Animal { public: void speak() { cout << "animal language!" << endl; } }; class Cat :public Animal { public: void speak() { cout << "cat language: miaomiao!" << endl; } }; int main() { Animal *p=new Cat; p->speak();
点击查看答案
第2题
【填空题】以下程序的输出结果为()。 main() {printf("*%f,%4.3f*n",3.14,3.1415); }
点击查看答案
第4题
【填空题】写出下面程序执行后的运行结果: #include<iostream> using namespace std; int main____ { char a[30],b[30]; int k; gets____; gets____; k=strcmp____; if____ puts____; else if____ puts____; return 0; } 输入love China 输出结果是什么?
点击查看答案
第5题
【填空题】写出下面程序执行后的运行结果: #include<iostream> using namespace std; int main____ { int k[30]={12,324,45,6,768,98,21,34,453,456}; int count=0,i=0; while____ { if____ count++; i++; } cout<< count <<","<<i<<endl; return 0; }
点击查看答案
第6题
写出下列程序段的输出结果: int a = 56; if (a>50 ) printf("A"); if (a>40 ) printf("B"); if (a>30 ) printf("C");
点击查看答案
第7题
【填空题】9.1读程序写出运行结果 public class t{ public static void main(String []args){ int week=3; while (week>0){ switch (week){ case 1: System.out.println("星期一"); case 2: System.out.println("星期二"); break; default: System.out.println("其他"); } week--; } }}
点击查看答案
第8题
【填空题】下列程序段运行的结果为() x=2; switch(x%3) { case 2: printf("Are "); case 1:printf("you "); case 0:printf("right"); default: printf("?"); }
点击查看答案
第9题
【填空题】写出下面程序执行后的运行结果。 #include< iostream> using namespace std; void main____ { int b = 5, y = 3; #define b 2 #define f____ b*x cout << f____; #undef b cout << f____; #define b 3 cout << f____; }
点击查看答案
第10题
【填空题】机器人RAPID程序类型有程序、()和()。
点击查看答案