已收录475621道考试试题

最后更新:2026-01-23

”“ 搜索结果

为您找到相关结果约475621

有以下程序 #include using namespace std; double power (double x, int n) { double val = 1.0; while (n--) val *= x; return(val); } int main() { int i; int value = 0; char ch; for (i=7; i>=0; i--) { cin >> ch; if (__________) value += power(2,i);} cout<
查看更多
有以下程序 #include using namespace std; class P{ char nameP; public: P(char *name="123"){strcpy(nameP,name);} char*getName(){ return nameP;} virtual char *getType(){ return "P";} }; class B:public P { char nameB; public: B(char*n1,char *n2):P(n1){strcpy(nameB,n2);} char *getName(){return nameB;} char*getType(){ return "B";} }; void showP(P *p){ cout<getType()<<":"<getName()<
查看更多
有以下程序,程序的功能是菜单选择:选择A输出:ADD;选择D输出:DELETE ;选择S输出:SORT;选择Q则退出。 #include using namespace std; int main() {char choice; while(________) { cout << "Menu: A(dd) D(elete) S(ort) Q(uit),Select one:"; cin >> choice; if (choice == 'A') {cout << "ADD" << endl; continue;} else if (choice == 'D') {cout << "DELETE " << endl; continue;} else if (choice == 'S') {cout << "SORT" << endl; continue;} else if (choice == 'Q') break; } } 请为横线处选择合适的程序( )
查看更多