Viết chương trình làm đẹp họ và tên
Code:
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
int main()
{
    char *s = new char[100];
    gets(s);
    int j = 1;
    for(int i = 0 ; i < strlen(s) ; i++)
    {
        if(j == 0)
            cout<<*(s+i);
        if(j != 0)
        {
            putchar(toupper(*(s+i)));
            j = 0;
        }
        if((int)*(s+i) == (int)' ')
            j++;
    }
    return 0;
}
 
 

