我真的想知道哪里错了
  • 板块P1765 手机
  • 楼主flyWang
  • 当前回复0
  • 已保存回复0
  • 发布时间2023/9/10 19:42
  • 上次更新2023/11/2 21:34:12
查看原帖
我真的想知道哪里错了
854995
flyWang楼主2023/9/10 19:42
#include<bits/stdc++.h>
using namespace std;
int main() {
	string text;
	getline(cin, text);
	// 1  a d g j m p t w 空格
	// 2 b e h k n q u x
	// 3  c f i l o r v y
	//4 s z	
	string one = "adgjmptw ";
	string two = "behknqux";
	string three = "cfilorvy";
	int count = 0;
	int size = text.size();
	for (int i = 0; i < size; i++) {
		if (one.find(text[i]) != string::npos) count += 1;
		else if (two.find(text[i]) != string::npos) count += 2;
		else if (three.find(text[i]) != string::npos) count += 3;
		else count += 4;
	}
	cout << count << endl;
	return 0;
}
2023/9/10 19:42
加载中...