不懂 为什么全wa
  • 板块P1765 手机
  • 楼主IamCXK
  • 当前回复4
  • 已保存回复4
  • 发布时间2022/12/29 20:17
  • 上次更新2023/10/24 06:11:24
查看原帖
不懂 为什么全wa
288932
IamCXK楼主2022/12/29 20:17
#include <iostream>
#include <bits/stdc++.h>
#include <string>

using namespace std;

int main()
{
    int letter[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};
    int count = 0;
    char ch;
    while((ch = getchar()) != EOF)
    {
        int a = ch - 'a';
        if(ch == ' ')
            count += 1;
        else
            count += letter[a];
        //cout<<ch<<' '<<count<<endl;
    }
    cout<<count;
    return 0;
}
2022/12/29 20:17
加载中...