Created
August 30, 2015 06:53
-
-
Save luckypapa/414e95b76e53feb83128 to your computer and use it in GitHub Desktop.
https://www.acmicpc.net/problem/3059 solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://www.acmicpc.net/problem/3059 | |
#include <stdio.h> | |
#define TOTAL_UPPER_ASCI 2015 | |
int getSumOfNoneChar(void) { | |
int data[26] = { 0 }; | |
int sum = TOTAL_UPPER_ASCI; | |
char temp[1000] = { 0 }; | |
scanf("%s", temp); | |
for (int i = 0; temp[i] != '\0'; i ++) { | |
data[temp[i] - 'A'] += 1; | |
} | |
for (int i = 0; i < 26; i++) { | |
if (data[i] != 0) | |
sum -= ('A' + i); | |
} | |
return sum; | |
} | |
int main(void) { | |
int T; | |
scanf("%d", &T); | |
while(T--) { | |
printf("%d\n", getSumOfNoneChar()); | |
} | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment