题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2024-04-19 23:43:37

[填空题]下列程序的输出结果是______。 #include <iostream> #include <cstring> using namespace std; void fun(const char*S,char &C) {e=s[strlen(s)/2];} int main( ){ char str[ ]="ABCDE"; char ch=str[1]; fun(str,ch); cout<<ch; return 0; }

更多"下列程序的输出结果是______。 #include <iost"的相关试题:

[填空题]以下程序执行后输出的结果是 【15】 。 #include<iostream> #include<fstream> using namespace std; int main( ){ ofstream ofile("D://temp.txt"); if(!ofile){ cout<<"temp.txt cannot open"<<endl; return 0; } ofile<<"This is a book" <<" " <<54321<<endl; ofile.close( ); ifstream ifile("D://temp.txt"); if(!ifile){ cout<<"temp.txt cannot open" <<endl; return 0; } charstr[40]; ifile >> str; ifile.close( ); cout<<Str<<endl; return 1; }
[填空题]以下程序的执行结果是 【15】 。 #include <iostream.h> #include <fstream.h> #include <stdlib.h> int main( ) { fstream outfile, infile; outfile.open("D://text.dat",ios::out); if(!outfile) { cout<<"text.dat can’t open"<<end1; abort( ); } outfile<<"1234567890"<<end1; outfile<<"abcdefghij"<<end1; outfile.close( ); infile.open("D:/text.dat",ios::in); if(!infile) { cout<<"text.dat can’t open"<<end1; abort ( ); } char textline[40]; int i=0; while(!infile.eof( )) { i++; infile.getline(textline,sizeof(textline)); cout<<i<<":"<<textline<<end1; } infile.close( ); return 0; }
[单项选择]如下程序的输出结果是 #include<iostream> #include<iomanip> using namespace std; class CSum{ int x,y; public: CSum(int x0,int y0):X(x0),y(y0){ } friend ostream& operator<<(ostream& os,const CSum& xA) { os<<setw(5)<<xa.x+xa.y: return os; } }; int main( ){ CSum y(3,5); cout<<setfill(’*’)<<8; cout<<y; return 0; }
A. 88
B. ****88
C. ****8****8
D. 8****8
[单项选择]如下程序的输出结果是 #include<iostream> #include<cstring> using namespace std; class XCF{ int a; public: XCF(int aa=0):a(aA) {cout<<"1";} XCF(XCF&X){a=x.a;cout<<"2";l ~XCF( ){cout<<a;} int Geta( )t return a;} }; int main( ){ XCF d(15),d2(d1); XCF*pd=new XCF(8); cout<<pd->Geta( ); delete pd; return 0; }
A. 1215588
B. 1218855
C. 12185
D. 128512
[填空题]下列程序的输出结果是 【9】 。 #include<iostream> #include<cstring> using namespace std; void fun(const char*s,char &c) {c=s[strlen(s)/2];} int main( ) { char str[]="ABCDE"; char ch=str[1]; fun(str, ch); cout<<ch; return 0;
[填空题]下列程序输出结果是 【13】
include <iostream>
using namespace std;
template <typename T>
T fun(T a, T b) return (a<=b)a:b;
int main( )

cout<<fun(3,6)<<’,’<<fim(3.14F, 6.28F)<<end 1;
return 0;

[填空题]以下程序的执行结果是_______。 #include<iostream.h> #include<fstream.h> #include<stdlib.h> void main( ) { char ch: fstream file: file.open("abc.dat",ios::out1ios::inlios::binary); if(! file) { cout<<“abc.dat文件不能打开”<<endl: abort( ); } file<<“12 34 56”<<endl: file.seekg(o,ios::beg): while(!file.eof( )) { streampos here=file.tellg( ); file.get(ch): if(ch==’’) cout<<here<<"": } cout<<endl: }
[单项选择]以下程序的输出结果是( )。
#include<iostream>
#include<stdlib>
using namespace std;
void func(char **m)

++m;
cout<<*m<<endl;

main( )

static char *a[]="MORNING","AFTERNOON","EVENING");
char **n;
n=a;
func(n);
system("PAUSE");
return 0;

A. 为空
B. MORNING
C. AFTERNOON
D. EVENING
[单项选择]下面程序的输出结果是( )。
#include<iostream>
#include<math.h>
using namespace std;
class point

private:
double x;
double y;
public:
point(double a,double b)

x=a;
y=b;

friend double distances(point a,point b);
;
double distances(point a,point b)

return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));

int main( )

point p1(1,2);
point p2(5,2);
cout<<distances(p1,p2)<<end1;
return 0;

A. 2
B. 4
C. 8
D. 16
[单项选择]下面程序的输出结果是( )。 #include<iostream> #include<string> using namespace std; void main( ){ charp1[10],p2[10]; strcpy(p1,"abc"); strcpy(p2,"ABC"); charstr[50]="xyz"; strcpy(str+2,strcat(p1,p2)); cout<<str; }
A. xyabcABC
B. yzabcABC
C. xyzabcABC
D. zabcABC
[填空题]以下程序的输出结果是 [9]
include<iostream.h>
include <string.h>
void main 0
char s[50];
strcpy(&s[O], "No" );
strcpy(&s[1], "123" );
strcpy (&s[2], "23456" );
cout<<s;

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码