-
Mangling Names - 17661Algorithm/BOJ 2020. 2. 28. 18:51123456789101112131415161718192021222324252627282930313233343536373839404142434445//17661 - Mangling Names#include <iostream>using namespace std;int N, K;int ans;int arr[31][31];void init(){scanf("%d%d", &N, &K);ans = 0;for(int i = 0; i<=N; ++i)for(int j = 0; j<=N; ++j)scanf("%d", &arr[i][j]);}void solve(){char c;int x = 0, y = 0;while((c = getchar()) != '\n'){if(c == 'a' || c == 'u' || c == 'i' || c == 'o' || c == 'e' || c == 'y')++x;else++y;}ans += arr[x][y];}int main(){int C; scanf("%d", &C);for(int tn = 0; tn<C; ++tn){init();getchar();for(int i = 0; i <K; ++i)solve();printf("Data Set %d:\n%d\n\n", tn+1, ans);}}
cs https://www.acmicpc.net/problem/17661
17661번: Mangling Names
Having figured out everyone’s first and last name, it’s time for everyone to walk across that stage, to cheers of friends and family, receive a degree, and hear one’s name pronounced/mangled. One has to have some pity, though, with the poor officials who h
www.acmicpc.net
Mangling Names
자음 모음 개수만 잘 세주면 되는 문제입니다.
아무것도 없는 한줄이 input으로 들어오는 경우가 있어 input만 잘 처리해 주면됩니다!
'Algorithm > BOJ' 카테고리의 다른 글
GPA - 17662 (0) 2020.02.28 Cap Size - 17659 (0) 2020.02.28 계단 수 - 1562 (0) 2020.02.26 10844 - 쉬운 계단 수 (0) 2020.02.26 욕심쟁이 판다 - 1937 (0) 2020.02.25