mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 16:16:25 +00:00
P1765 手机
R38667223
This commit is contained in:
parent
a2a33e62da
commit
1af14a2a51
23
problem/P1765/P1765.cpp
Normal file
23
problem/P1765/P1765.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
// R38667223
|
||||
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int num[26] = {1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 4};
|
||||
// a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v. w, x, y, z
|
||||
int main() {
|
||||
char c;
|
||||
int cnt = 0;
|
||||
while (scanf("%c", &c) != EOF) {
|
||||
if (c == ' ') {
|
||||
cnt++;
|
||||
}
|
||||
else if('a' <= c && c <= 'z') {
|
||||
cnt += num[c - 'a'];
|
||||
}
|
||||
// cout << c << ' ' << cnt << endl;
|
||||
}
|
||||
cout << cnt << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user