#21108: C++內建函式解


fdhs107_KonChin_Shih (Konchin)

School : 桃園市私立復旦高級中學
ID : 69313
IP address : [140.113.67.166]
Last Login :
2023-09-12 01:03:45
e840. P7. 密碼強度測試(Passwords) -- 2019年08月TOI新手同好會 | From: [1.160.180.32] | Post Date : 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)

School : 桃園市私立復旦高級中學
ID : 102099
IP address : [140.114.217.85]
Last Login :
2024-03-27 01:07:43
e840. P7. 密碼強度測試(Passwords) -- 2019年08月TOI新手同好會 | From: [59.115.68.22] | Post Date : 2020-04-13 00:53

不要貼答案啦

別人還要玩

 
 
ZeroJudge Forum