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(".");

}

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

Powered by Blogger.