We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Why is it saying that my answer is wrong even though it matches with the expected output?
`#include<stdio.h>#include<string.h>#include<math.h>#include<stdlib.h>#include<ctype.h>voidsplit(chartype,char*words,intlen){intindex=0;if(type=='C'){printf("%c",tolower(words[0]));index=1;}for(;index<len-2;++index){if(65<=words[index]&&words[index]<=90){// capitalwords[index]=tolower(words[index]);printf(" %c",words[index]);}else{printf("%c",words[index]);}}if(type=='V'||type=='C'){printf("%c%c",words[len-2],words[len-1]);}}voidcombine(chartype,char*words,intlen){inti=0;if(type=='C'){printf("%c",toupper(words[0]));i=1;}for(;i<len;++i){if(words[i]==' '){words[i+1]=toupper(words[i+1]);continue;}printf("%c",words[i]);}if(type=='M'){printf("()");}}intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */charoperation[2],type[2],words[256];while(scanf("%1s;%1s;%[^\n]",operation,type,words)!=EOF){if(operation[0]=='S'){intlen=strlen(words);split(type[0],words,len);printf("\n");}elseif(operation[0]=='C'){intlen=strlen(words);combine(type[0],words,len);printf("\n");}}return0;}
`
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Camel Case 4
You are viewing a single comment's thread. Return to all comments →
Why is it saying that my answer is wrong even though it matches with the expected output?
`