Toph Better Passwords Solution
Solve in C:
#include<stdio.h>
#include<string.h>
int main()
{
int n,i,l;
char s[100];
scanf("%s",s);
l=strlen(s);
for(i=0; i<l; i++)
{
if(i==0)
{
if(s[0]>='a'&&s[0]<='z')
printf("%c",s[0]-32);
else if(s[0]>='A'&&s[0]<='Z')
printf("%c",s[0]);
}
else
if(s[i]=='s')
printf("$");
else if(s[i]=='i')
printf("!");
else if(s[i]=='o')
printf("()");
else
printf("%c",s[i]);
}
printf(".");
}
#include<stdio.h>
#include<string.h>
int main()
{
int n,i,l;
char s[100];
scanf("%s",s);
l=strlen(s);
for(i=0; i<l; i++)
{
if(i==0)
{
if(s[0]>='a'&&s[0]<='z')
printf("%c",s[0]-32);
else if(s[0]>='A'&&s[0]<='Z')
printf("%c",s[0]);
}
else
if(s[i]=='s')
printf("$");
else if(s[i]=='i')
printf("!");
else if(s[i]=='o')
printf("()");
else
printf("%c",s[i]);
}
printf(".");
}
No comments