更多"下列程序用于将源文件中的字母进行大小写转换,请填写while的请句。 "的相关试题:
[填空题]下列程序用于将源文件中的字母进行大小写转换,请填写while的请句。
#include<iostream.h>
#include<fstream.h>
#include<iomanip.h>
void main( )
char ch;
fstream file1,file2;
char fnl[10],fn2[10];
cout<<“输入源文件名:”;
cin>>fn1;
cout<<“输入目标文件名:”;
cin>>fn2;
ilel.open(fn1,ios::in);
while( )
证(ch)=,a,&&ch<=’z,)
ch=ch-/a/+’A’;
file2.put(ch);
file1.close( );
file2.close( );
[填空题]下列程序用于将源文件中的字母进行大小写转换,请填写while语句。
#include<iostream.h>
#include<fstream.h>
#include<iomanip.h>
void main( )
char ch;
fstream file1,file2;
char fn1[10],fn2[10];
cout<<"输入源文件名:";
cin>>fn1;
cout<<"输入目标文件名:";
cin>>fn2;
file1.open(fn1,ios::in);
while(______)
if(ch>=’a’&&ch<=’z’)
ch=ch=’a’+’A’;
file2.put(ch);
file1.close( );
file2.close( );
[填空题]下列程序用于将源文件中的字母进行大小写转换,while的条件是 【14】 。
#include<iostream. h>
#include<fstream. h>
#include<iomanip. h>
void main( )
char ch;
fstream filel, file2
char fn1[10], fn2[10];
cout<<"输入源文件名:";
cin>>fn1
cout<<"输入目标文件名:";
tin>>fn2
file1, open(fn1 ,ios: :in);
file2, open(fn2, ios:: out);
while(________)
if(ch>=’a’&&ch<=’z’)
ch=ch-’a’+’A’,
file2, put(ch),
file1, close( ),
file2, close( );
[填空题]下列程序用于将源文件中的字母进行大小写转换,while的条件是______。
#include<iostream.h>
#include<fstream.h>
#include<iomanip.h>
void main( )
char ch;
fstream filel,file2;
char fnl[10],fn2[10];
cout<<"输入源文件名:";
cin>>fn1;
cout<<"输入目标文件名:";
cin>>fn2;
filel.open(fnl,ios::in);
file2.open(fn2,ios::out);
while(______)
if(ch>=’a’&&ch<=’z’)
ch=ch=’a’+’A’;
file2.put(ch);
filel.close( );
file2.close( );
[填空题]下列程序用于将源文件中的字母进行大小写转换,while的条件是 【14】 。
#include<iostream. h>
#include<fstream. h>
#include<iomanip. h>
void main( )
}
char ch;
fstream filel, file2
char fn1[10], fn2[10];
cout<<"输入源文件名:";
cin>>fn1
cout<<"输入目标文件名:";
tin>>fn2
file1, open(fn1 ,ios: :in);
file2, open(fn2, ios:: out);
while(________)
{
if(ch>=’a’&&ch<=’z’)
ch=ch-’a’+’A’,
file2, put(ch),
}
file1, close( ),
file2, close( );
}
[填空题]Java是区分大小写的。源文件名与程序类名必须相同,其扩展名为 ______,源文件中最多只能有一个 ______ 类,其他类的个数不限。
[填空题]在下面的程序的横线处填上适当的语句,使该程序的输出结果为12。
#include<iostream>
using namespace std;
class TestClass
{
public:
int a,b;
TestClass(int i,int j)
{
a=i;
b=j;
}
};
class TestClass1:public TestClass
{
int a;
public:
TestClass1(int x):TestClass(x,x+1){}
void show( )
{
______;∥输出基类数据成员a的值
cout<<b<<endl;
}
};
int main( )
{
TestClass1 d(1);
d.show( );
return 0;
}
[填空题]在下面程序的横线处填上适当的语句,使程序执行后的输出结果为ABCD。
#include<iostream>
using namespace std;
classA
public:
A( )cout<<’A’;
;
class B:______
public:
B( )cout<<’B’;
;
class C:______
public:C( )cout<<’C’;
;
class D:public B,public C
public:D( )cout<<’D’;
;
void main( )D obj;)
[填空题]在下面程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。
#include<iostream.h>
using namespace std;
class A
public:A( )cout<<‘A’;
;
class B:______
public:B( )cout<<‘B’;)
;
class C://______
public:C( )cout<<‘C’;
;
class D://public B,public C
public:D( )cout<<‘D’;
;
void main( )D obj;
[单项选择]在下列程序的横线处填上适当的内容,使程序执行后的输出结果为ABCD。
#include<iostream>
using namespace std;
class A
public:A( )cout<<‘A’;
;
Class B:
public:B( )cout<<‘B’;
;
class C://virtual public A
public:C( )cout<<‘C’;
;
class D://public B,public D
public:D( )tout<<‘D’;
;
void main( )D obj;
A. public A
B. private A
C. protected A
D. virtual public A
[单项选择]为使该程序执行结果为10,那么应该在程序划线处填入的语句是( )。 #include<iostream> using namespace std; class MyClass { public: MyClass (int a) { x=a; } ___________ //取x值 private: int x; }; int main( ) { MyClass my(10); cout<<my.GetNum( )<<end1; return 0; }
A. return x;
B. int GetNum(){ return x;}
C. intreturn x;
D. void GetNum(){return x;}
[填空题]以下程序设计功能是:将结构体变量time 中的内容写到文件中。
#include <iostream>
using namespace std;
struct date
{
int year;
int month;
int day;
}
int main ( )
{
date time = { 2005, 1, 1 };
ofstream outdate;
outdate.open( "d://date.txt", ios :: binary );
outdate.write(____________, sizeof( tt ) );
outdate.close( );
return 0;
}
则程序中空白处应该填入的语句为 【15】 。