#include
#include
char k[100], l;
int p;
int input ()
{
cout<<" Masukkan Kalimat = ";
cin.getline(k,sizeof(k));
p=strlen(k);
return (p);
}
char proses (int p)
{
int i;
char s[5];
s[0]=k[0];
s[1]='\0';
strlwr(s);
k[0]=s[0];
for (i=1;i<=p;i++)
{
if(k[i]=='\0')
k[i-1]='#';
else if(k[i]==' ')
{
{
k[i]='|';
k[i-1]='#';
s[0]=k[i+1];
s[1]='\0';
strlwr(s);
k[i+1]=s[0];
i++;
}
}
else if (k[i]>='A'&&k[i]<='Z')
{
s[0]=k[i];
s[1]='\0';
strlwr(s);
k[i]=s[0];
}
else if (k[i]>='a'&&k[i]<='z')
{
s[0]=k[i];
s[1]='\0';
strupr(s);
k[i]=s[0];
}
}
}
void output ()
{
cout<<" Output :\n"<
main ()
{
cout<<"==========================================================="<
p=input();
proses(p);
output();
getch();
}
0 komentar:
Posting Komentar