This commit is contained in:
2026-01-22 23:51:20 +08:00
parent 04aa2ffc7d
commit 124c7332d8
4 changed files with 109 additions and 0 deletions

23
26/01/comp/18q1.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include <string>
class Solution {
public:
int vowelConsonantScore(std::string s) {
int v =0,c=0;
std::string col = "aeiou";
for (auto i : s) {
if (i > 122 || i < 97) {
continue;
}
if (col.find(i) != std::string::npos) {
v++;
}else {
c++;
}
}
if (c==0) {
return 0;
}
return v/c;
}
};