Facebook
From Unique Bee, 6 Years ago, written in C++.
This paste is a reply to Zadanie 2 from Obese Duck - go back
Embed
Viewing differences between Zadanie 2 and Re: Zadanie 2
int main(void)
{
        char T[101];

        char Y[101];

        int roz = sizeof(T);
        cout << "Podaj tekst o maksymalnie " << roz-1 << " znakach: ";
        cin.getline(T,100);
        
        strcpy(Y, T);

        for (int i = 0; i < roz; i++)
        {
                if (isupper(Y[i]))
                {
                        Y[i] = tolower(Y[i]);
                }

                if (islower(Y[i]))
                {
                Y[i] = toupper(Y[i]);
                }
                
                Y[roz - 1 - i] = Y[i];
        }
        cout << Y;