#include<iostream>
#include <string>
using namespace std;
int main(int argc, char** argv)
{
string Text;
cin>>Text;
for(int i = 1; i <= Text.size() ; i++)
{
Text[i] = toupper(Text[i]);
}
cout << Text;
return 0;//정상종료시 반드시 0을 리턴해야합니다.
}
1) 필요한 함수를 사용하기 위해 string 클래스를 include한다.
2) 소문자 -> 대문자: toupper, 대문자 -> 소문자: tolower 함수를 사용하면 된다.
3) 사용법:
str = "바꾸고자 하는 문자" ;
for (i=0; i<str.size(); i++) {
str[i] = toupper(str[i]); //소문자 -> 대문자
str[i] = tolower(str[i]); // 대문자 -> 소문자
}