#include <iostream>
#include <string>
using namespace std;
 
int main() 
{
        string s;
 
        cout << "enter a string: ";
        cin >> s;
 
        for (int i = 0; i < s.length(); i++)
               if ('a' <= s[i] && s[i] <= 'z')
                       s[i] = s[i] - ('a' - 'A');
               
        cout << s << endl;
 
        return 0;
}

syntax highlighted by Code2HTML, v. 0.9.1