hello
I am beginner
i just unable to find the errors
my problem is working on visual studio
but not in codechef compiler
please tell me why i am getting error
my code is
#include <iostream>
#include <string>
using namespace std;
int main()
{
int z,i,l,k,d,T,m;
cin>>T;
for(m=0;m<=T;m++)
{
string hj,str1,str2, str3,ch,s;
z=0;
l=0;
getline(cin,s);
d=strlen(s);
str2[0]= '\0';
for(k=0;s[k]!=d;k++)
{
if(s[k]>=65&&s[k]<=90)
{
s[k]=s[k]+32;
}
}
strcat(hj,s);
for(i=0;hj[i]!= '\0';i++)
{
str3[l]=hj[i];
l++;
ch=hj[i];
if(ch==' ')
{
str1[0]=hj[z]-32;
str1[1]='\0';
strcat(str2,str1);
strcat(str2,".");
z=i+1;
l=0;
}
}
str3[l]='\0';
strcat(str2,str3);
strcat(str2,"\0");
cout<<str2<<endl;
}
return 0;
}