Advertisement
Guest User

Untitled

a guest
Aug 14th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. string i;
  4. int b;
  5. main() {
  6.     while( getline( cin, i ) ) {
  7.         for( auto a : i ) {
  8.         if( a > 96 && a <= 'z' )
  9.             b += a - 96;
  10.         if( a > 47 && a < 58 )
  11.             b += 61 - a;
  12.         if( a > 64 && a < 'Z' )
  13.             b += a - 54;
  14.         if( a == ' ' )
  15.             b += 4;
  16.         if( a == 46 )
  17.             b += 5;
  18.         if( a == ';' )
  19.             b += 7;
  20.         if( a == ',' )
  21.             b += 2;
  22.         if( a == '=' || a == '+' || a == '-' || a == '\'' || a == '\"' )
  23.             b += 3;
  24.         if(  a == '(' || a == ')' )
  25.             ++b;
  26.         if( a == '[' || a == ']' || a == '{' || a == '}' || a == '<' || a == '>' )
  27.             b += 8;
  28.     }
  29.     }
  30.     cout << b;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement