#21108: C++內建函式解


fdhs107_KonChin_Shih (Konchin)

學校 : 桃園市私立復旦高級中學
編號 : 69313
來源 : [140.113.67.166]
最後登入時間 :
2023-09-12 01:03:45
e840. P7. 密碼強度測試(Passwords) -- 2019年08月TOI新手同好會 | From: [1.160.180.32] | 發表日期 : 2020-04-12 17:51

#include<iostream>

#include<cctype>

#include<algorithm>

using namespace std;

int main() {

string str; cin >> str;

int n = str.size();

int e = count_if(str.begin(), str.end(), [](auto x) {return isalpha(x);});

int d = count_if(str.begin(), str.end(), [](auto x) {return isdigit(x);});

int c = str.end() - unique(str.begin(), str.end(), [](auto a, auto b) {return isdigit(a) && isdigit(b);});

cout << n * 3 + e * 3 + d * 2 - !e * n - !d * n - c * 2 + (e && d && n >= 8 ? 10 : -5) << endl;

return 0;

}

 

 
#21110: Re:C++內建函式解


fdhs109_GT (GT coding)

學校 : 桃園市私立復旦高級中學
編號 : 102099
來源 : [140.114.217.85]
最後登入時間 :
2024-03-27 01:07:43
e840. P7. 密碼強度測試(Passwords) -- 2019年08月TOI新手同好會 | From: [59.115.68.22] | 發表日期 : 2020-04-13 00:53

不要貼答案啦

別人還要玩

 
 
ZeroJudge Forum