为什么我的不输出?
查看原帖
为什么我的不输出?
942429
hpsnail2013楼主2024/2/24 17:24

蒟蒻求助!代码不输出。感谢万分!

#include <iostream>
#include<string>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
string a;
string b;
int main(int argc, char** argv) {
	cin>>a;
	int c=0;
	int x=0;
	int d=0;
	int s=0;
	for(int i=0;i<=a.length();i++){
		if(a[i]!=','){
			b[i]=a[i];
		}
		for(int j=0;j<=b.length();j++){
			if(b.length()<=12 && b.length()>=6){
				c=1;
				if(b[j]<='z' && b[j]>='a'){
					x=1;
				}
				if(b[j]<='Z' && b[j]>='A'){
					d=1;
				}
				if(b[j]<=9 && b[j]>=0){
					s=1;
				}
			}
		}
		for(int k=0;k<=b.length();k++){
			if(c==1){
				if((x==1 && d==1) || (x==1 && s==1) || (d==1 && s==1)){
					cout<<b<<endl;
				}
				else{
					continue;
				}
			}
			else{
				continue;
			}
		}
	}
	return 0;
}
2024/2/24 17:24
加载中...