网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
以下程序执行后输出的结果是【】。 include include using namespace std; int
以下程序执行后输出的结果是【 】。
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;
}
参考答案
更多 “ 以下程序执行后输出的结果是【】。 include include using namespace std; int 以下程序执行后输出的结果是【 】。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;} ” 相关考题
考题
执行如下程序后的输出结果是【】。include include using namespace std;int ma
执行如下程序后的输出结果是【 】。include <iostream>include <fstream>using namespace std;int main ( ){char s[25];ofstream fl("data.txt");f1<<"C++ Programming";f1.close ();ifstream f2 ("data.txt");
考题
有如下的程序: include include using namespace std; int main() { ofstr
有如下的程序:include <iostream>include <fstream>using namespace std;int main(){ofstream outf("D:\\temp.txt",ios_base::trunc) ;outf<<"World Wide Web";outf.close();ifstream inf("D:\\temp.txt");char s[20];inf>>s;inf.close();cout<<s;return 0;}执行后的输出结果是【 】。
考题
以下程序的输出结果是【】。includevoid main() {int *p;p=new int;*p=200;cout
以下程序的输出结果是【 】。include<iostream. h>void main() {int *p;p=new int;*p=200;cout<<*p;delete p;}
考题
有以下程序includeint i=0;void fun(){{ Static int i=1 Std::cont
有以下程序 #include<iostream,h> int i=0; void fun() { { Static int i=1 Std::cont<<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,
考题
有以下程序: include int i=0;void fun(){{static iht i=1; std::cout
有以下程序: # include <iostream> int i=0; void fun() {{static iht 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,
考题
以下程序的执行结果是【】。 include include include int ma
以下程序的执行结果是【 】。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
考题
以下程序的执行结果是_______。 include include include void
以下程序的执行结果是_______。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
考题
有以下程序include int i = 0;void fun( ){ {static int i = 1;std::cout
有以下程序 #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,
考题
以下程序执行后的输出结果是include.using namespace std;void try(int,int,int,int)
以下程序执行后的输出结果是 #include<iostream>. using namespace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定
热门标签
最新试卷