Timus Problem 1567 Solution

Timus Problem Solution

Timus Problem 1567 Solution

#include <stdio.h>

int main()

{

    char c;

    int i,sum=0;

while(scanf("%c",&c)==1){

if(c=='a')

sum+=1;

else if(c=='b')

sum+=2;

else if(c=='c')

sum+=3;

else if(c=='d')

sum+=1;

else if(c=='e')

sum+=2;

else if(c=='f')

sum+=3;

else if(c=='g')

sum+=1;

else if(c=='h')

sum+=2;

else if(c=='i')

sum+=3;

else if(c=='j')

sum+=1;

else if(c=='k')

sum+=2;

else if(c=='l')

sum+=3;

else if(c=='m')

sum+=1;

else if(c=='n')

sum+=2;

else if(c=='o')

sum+=3;

else if(c=='p')

sum+=1;

else if(c=='q')

sum+=2;

else if(c=='r')

sum+=3;

else if(c=='s')

sum+=1;

else if(c=='t')

sum+=2;

else if(c=='u')

sum+=3;

else if(c=='v')

sum+=1;

else if(c=='w')

sum+=2;

else if(c=='x')

sum+=3;

else if(c=='y')

sum+=1;

else if(c=='z')

sum+=2;

else if(c=='.')

sum+=1;

else if(c==',')

sum+=2;

else if(c=='!')

sum+=3;

else if(c==' ')

sum+=1;

    }

    printf("%d",sum);



    return 0;

}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...