Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- int main(){
- char str[100];
- while(scanf("%[^\n]",str)!=EOF){
- getchar();
- //printf("%s\n",str);
- int flag=1,tam,i;
- tam=strlen(str);
- for(i=0;i<tam;i++){
- if(str[i]==' ');
- else if(flag){
- str[i]=toupper(str[i]);
- flag=0;
- }
- else{
- str[i]=tolower(str[i]);
- flag=1;
- }
- }
- printf("%s\n",str);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement