#2218: ans(c++)


1752786-4@g.puiching.edu.mo (林敬晉P5A08(JalenLam_progamer)(IQ...)

School : Pui Ching Middle School
ID : 3260
IP address : [192.168.120.33]
Last Login :
2025-06-05 11:37:15
b230. PG3_2403_字母求和 -- CCF GESP | From: [192.168.120.33] | Post Date : 2025-06-02 21:02

#include<bits/stdc++.h>

using namespace std;

int main(){

    int nothing;

    cin>>nothing;

    string str;

    cin>>str;

    int sum=0;

    for(char i:str){

        if('A' <= i && i <= 'Z') sum += -(int)i;

        else sum += ((int)i)-96;

    }

    cout<<sum;

}

// JalenLam_progamer

 
ZeroJudge Forum