8:将数组S中所有小写字母改写成大写字母。
#include <iostream.h>
#include <fstream.h>
#include <string.h>
void fun(char s[])
{
/**********Program**********/
for(int i=0;i<80;i++)
{
if(s[i]>'Z')
s[i]=s[i]-32;
cout<<s[i];
}
/********** End **********/
}
void wwjt(char []);
void main()
{
char s[80] = " abdsaFDSAFdsafASFDSafghHFDHTjte" ;
fun(s);
wwjt(s);
}
void wwjt(char s[])
{
fstream myfile;
myfile.open(" out.dat" ,ios::out);
myfile<<s<<endl;
myfile.close();
}
#include <iostream.h>
#include <fstream.h>
#include <string.h>
void fun(char s[])
{
/**********Program**********/
for(int i=0;i<80;i++)
{
if(s[i]>'Z')
s[i]=s[i]-32;
cout<<s[i];
}
/********** End **********/
}
void wwjt(char []);
void main()
{
char s[80] = " abdsaFDSAFdsafASFDSafghHFDHTjte" ;
fun(s);
wwjt(s);
}
void wwjt(char s[])
{
fstream myfile;
myfile.open(" out.dat" ,ios::out);
myfile<<s<<endl;
myfile.close();
}