RE求条,九月认证快到了
查看原帖
RE求条,九月认证快到了
1086443
Innate_Joker楼主2024/8/13 12:23
#include <cstring>
#include <iostream>
using namespace std;
int main() {
	char pinn[1000];
	cin.getline(pinn,1000);
	int len = strlen(pinn);
	for(int i = 0; i < len; i ++ ) {
		char pin[100];
		int j = i,lenn = 0;
		while(pinn[j] != ',') {
			pin[lenn ++ ] = pinn[j ++ ];
		}
		i = j;
		bool small = false;
		bool big = false;
		bool special = false;
		bool number = false;
		for(int p = 0; p < strlen(pin); p ++ ) {
			if(pin[p] == '!' || pin[p] == '@' ||
			   pin[p] == '#' || pin[p] == '$') {
				special = true;
			}
			if(pin[p] >= 'a' && pin[p] <= 'z') {
				small = true;
			}
			if(pin[p] >= 'A' && pin[p] <= 'Z') {
				big = true;
			}
			if(pin[p] >= '0' && pin[p] <= '9') {
				number = true;
			}
		}
		short total = 0;
		if(small == true) {
			total ++;
		}
		if(big == true) {
			total ++;
		}
		if(number == true) {
			total ++;
		}
		if(special == true && total >= 2 && lenn >= 6 && lenn <= 12) {
			cout << pin << ' ' << special << ' ' << total << endl;
		}
	}
	return 0;
}

Error:

Runtime Error.
Received signal 11: Segmentation fault with invalid memory reference.

Chinese:

运行时出错。
接收到信号 11:分段故障,内存引用无效。
2024/8/13 12:23
加载中...