Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Chuanhoa(char s[])
- {
- int f = 0;
- char cur[MAX];
- int j = 0;
- for (int i=0; i<MAX; i++)
- {
- if (s[i]==' ')
- {
- if (f)
- {
- f = 0;
- cur[j] = ' ';
- ++j;
- }
- }
- else
- {
- if (f==0)
- {
- cur[j] = toupper(s[i]);
- j++;
- f = 2;
- }
- else if (f==2)
- {
- cur[j] = tolower(s[i]);
- ++j;
- }
- }
- }
- for (int i=0; i<300; i++) s[i] = cur[i];
- }
Advertisement
Add Comment
Please, Sign In to add comment