#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAX 100
void thuongSangHoa(char a[MAX]){
for (int i = 0; i < n; i++)
{
if (a[i] >= 97 && a[i] <= 122)
{
a[i] -= 32;
}
}
}
void hoaSangThuong(char a[MAX]){
for (int i = 0; i < n; i++)
{
if (a[i] >= 65 && a[i] <= 90)
{
a[i] += 32;
}
}
}
void kyTuDauInHoa(char a[MAX]){
hoaSangThuong(a);
for (int i = 0; i < n; i++)
{
if (a[i] == ' ')
{
a[i + 1] -= 32;
}
}
a[0] -= 32;
}
int main(){
char a[MAX];
thuongSangHoa(a);
printf("Chuoi sua khi chuyen sang chu in hoa: "); for (int i
= 0; i
< strlen(a
); i
++) {
}
hoaSangThuong(a);
printf("\nChuoi sua khi chuyen sang chu thuong: "); for (int i
= 0; i
< strlen(a
); i
++) {
}
kyTuDauInHoa(a);
printf("\nChuoi sua khi chuyen sang chu ky tu dau la in hoa: "); for (int i
= 0; i
< strlen(a
); i
++) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0cmluZy5oPgoKI2RlZmluZSBNQVggMTAwCnZvaWQgdGh1b25nU2FuZ0hvYShjaGFyIGFbTUFYXSl7CiAgICBpbnQgbiA9IHN0cmxlbihhKTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKQogICAgewogICAgICAgIGlmIChhW2ldID49IDk3ICYmIGFbaV0gPD0gMTIyKQogICAgICAgIHsKICAgICAgICAgICAgYVtpXSAtPSAzMjsKICAgICAgICB9CiAgICAgICAgCiAgICB9CiAgICAKfQoKdm9pZCBob2FTYW5nVGh1b25nKGNoYXIgYVtNQVhdKXsKICAgIGludCBuID0gc3RybGVuKGEpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspCiAgICB7CiAgICAgICAgaWYgKGFbaV0gPj0gNjUgJiYgYVtpXSA8PSA5MCkKICAgICAgICB7CiAgICAgICAgICAgIGFbaV0gKz0gMzI7CiAgICAgICAgfQogICAgICAgIAogICAgfQogICAgCn0KCnZvaWQga3lUdURhdUluSG9hKGNoYXIgYVtNQVhdKXsKICAgIGludCBuID0gc3RybGVuKGEpOwogICAgaG9hU2FuZ1RodW9uZyhhKTsKCiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykKICAgIHsKICAgICAgICBpZiAoYVtpXSA9PSAnICcpCiAgICAgICAgewogICAgICAgICAgICBhW2kgKyAxXSAtPSAzMjsKICAgICAgICB9CiAgICB9CgogICAgYVswXSAtPSAzMjsKICAgIAp9CgppbnQgbWFpbigpewogICAgc3lzdGVtKCJjbHMiKTsKICAgIGNoYXIgYVtNQVhdOwogICAgcHJpbnRmKCJOaGFwIHZhbyBjaHVvaTogIik7CiAgICBnZXRzKGEpOwoKICAgIHRodW9uZ1NhbmdIb2EoYSk7CiAgICBwcmludGYoIkNodW9pIHN1YSBraGkgY2h1eWVuIHNhbmcgY2h1IGluIGhvYTogIik7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IHN0cmxlbihhKTsgaSsrKQogICAgewogICAgICAgIHByaW50ZigiJWMiLCBhW2ldKTsKICAgIH0KCiAgICBob2FTYW5nVGh1b25nKGEpOwogICAgcHJpbnRmKCJcbkNodW9pIHN1YSBraGkgY2h1eWVuIHNhbmcgY2h1IHRodW9uZzogIik7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IHN0cmxlbihhKTsgaSsrKQogICAgewogICAgICAgIHByaW50ZigiJWMiLCBhW2ldKTsKICAgIH0KCiAgICBreVR1RGF1SW5Ib2EoYSk7CiAgICBwcmludGYoIlxuQ2h1b2kgc3VhIGtoaSBjaHV5ZW4gc2FuZyBjaHUga3kgdHUgZGF1IGxhIGluIGhvYTogIik7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IHN0cmxlbihhKTsgaSsrKQogICAgewogICAgICAgIHByaW50ZigiJWMiLCBhW2ldKTsKICAgIH0KCiAgICByZXR1cm4gMDsKfQ==