把小写变成大写小程序

#include "iostream.h"
//using namespace std;
char up(char j)
{
 if(j>=97&&j<=122)
  return j-32;
 else
  return j;
}
void main()
{
 char a[10],c;
 for(int i=0;i<10;i++)
 {
  cin>>c;
  a[i]=c;

 }
 for(int h=0;h<10;h++)
 {
  cout<<a[h];
 }
 cout<<endl;
 for(int k=0;k<10;k++)
 {
  cout<<up(a[k]);
 }
 cout<<endl;

}

C++ 的是用#include <iostream>

                using namespace std;

VC++6.0用这就这就可以了#include<iostream.h>

posted @ 2013-07-06 23:10  army168  阅读(604)  评论(0)    收藏  举报