Better Passwords
Limits
1s, 512 MB
Byang is creating an account on Toph. He needs your help to create a strong password.
Byang will give you a word, and you will need to make the following changes to the word to make it a stronger password:
Byang will give you a word, and you will need to make the following changes to the word to make it a stronger password:
- Make the first character an uppercase
- Replace all
s
with$
- Replace all
i
with!
- Replace all
o
with()
- Append a
.
(period) at the end of the password
Input
The input will contain a string A (Length of A < 16). A will contain lowercase alphabets only.
Output
Print the better password after applying all of the necessary changes to the original word A.
#include <stdio.h>
#include <math.h>
#include <string.h>
int main()
{
char ara[20];
gets(ara);
if(ara[0] >= 'a' && ara[0] < 'z') {
ara[0] = ara[0] + 'A' - 'a';
}
int l = strlen(ara), i, j;
ara[l] = '.';
l++;
for(i = 0; i < l; i++) {
if(ara[i] == 'i') {
ara[i] = '!';
}
else if(ara[i] == 's') {
ara[i] = '$';
}
else if(ara[i] == 'o') {
l++;
for(j = l; j > i + 1; j--) {
ara[j] = ara[j - 1];
}
ara[i] = '(';
ara[i + 1] = ')';
}
else {
continue;
}
}
for(i = 0; i < l; i++) {
printf("%c", ara[i]);
}
return 0;
}