Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- string i;
- int b;
- main() {
- while( getline( cin, i ) ) {
- for( auto a : i ) {
- if( a > 96 && a <= 'z' )
- b += a - 96;
- if( a > 47 && a < 58 )
- b += 61 - a;
- if( a > 64 && a < 'Z' )
- b += a - 54;
- if( a == ' ' )
- b += 4;
- if( a == 46 )
- b += 5;
- if( a == ';' )
- b += 7;
- if( a == ',' )
- b += 2;
- if( a == '=' || a == '+' || a == '-' || a == '\'' || a == '\"' )
- b += 3;
- if( a == '(' || a == ')' )
- ++b;
- if( a == '[' || a == ']' || a == '{' || a == '}' || a == '<' || a == '>' )
- b += 8;
- }
- }
- cout << b;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement