codice:
#include<stdio.h>
#include<windows.h>
char box[]=
{'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l',
'm','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,zero,uno,due,tre,quattro,
cinque,sei,sette,otto,nove,dieci;
int c1,c2;
int validCode(char* string){
A=B=C=D=E=F=G=H=I=J=K=L=M=N=O=P=Q=R=S=T=U=V=W=X=Y=Z=zero=uno=due=tre=quattro=cinque=sei=sette=otto=nove=dieci=0;
for(c1=0;c1<25;c1++){
if(string[c1]==box[0]) zero++;
if(string[c1]==box[1]) uno++;
if(string[c1]==box[2]) due++;
if(string[c1]==box[3]) tre++;
if(string[c1]==box[4]) quattro++;
if(string[c1]==box[5]) cinque++;
if(string[c1]==box[6]) sei++;
if(string[c1]==box[7]) sette++;
if(string[c1]==box[8]) otto++;
if(string[c1]==box[9]) nove++;
if(string[c1]==box[10]) dieci++;
if(string[c1]==box[11]) A++;
if(string[c1]==box[12]) B++;
if(string[c1]==box[13]) C++;
if(string[c1]==box[14]) D++;
if(string[c1]==box[15]) E++;
if(string[c1]==box[16]) F++;
if(string[c1]==box[17]) G++;
if(string[c1]==box[18]) H++;
if(string[c1]==box[19]) I++;
if(string[c1]==box[20]) J++;
if(string[c1]==box[21]) K++;
if(string[c1]==box[22]) L++;
if(string[c1]==box[23]) M++;
if(string[c1]==box[24]) N++;
if(string[c1]==box[25]) O++;
if(string[c1]==box[26]) P++;
if(string[c1]==box[27]) Q++;
if(string[c1]==box[28]) R++;
if(string[c1]==box[29]) S++;
if(string[c1]==box[30]) T++;
if(string[c1]==box[31]) U++;
if(string[c1]==box[32]) V++;
if(string[c1]==box[33]) W++;
if(string[c1]==box[34]) X++;
if(string[c1]==box[35]) Y++;
if(string[c1]==box[36]) Z++;
}
if(A>4||B>4||C>4||D>4||E>4||F>4||G>4||H>4||I>4||J>4||K>4||
L>4||M>4||N>4||O>4||P>4||Q>4||R>4||S>4||T>4||U>4||V>4||W>4||
X>4||Y>4||Z>4||zero>4||uno>4||due>4||tre>4||quattro>4||
cinque>4||sei>4||sette>4||otto>4||nove>4||dieci) return 0;
return 1;
}
main()
{
int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;
char buf[24];
for(a = 0;a<36;a++)
for(b = 0;b<36;b++)
for(c = 0;c<36;c++)
for(d = 0;d<36;d++)
for(e = 0;e<36;e++)
for(f = 0;f<36;f++)
for(g = 0;g<36;g++)
for(h = 0;h<36;h++)
for(i = 0;i<36;i++)
for(j = 0;j<36;j++)
for(k = 0;k<36;k++)
for(l = 0;l<36;l++)
for(m = 0;m<36;m++)
for(n = 0;n<36;n++)
for(o = 0;o<36;o++)
for(p = 0;p<36;p++)
for(q = 0;q<36;q++)
for(r = 0;r<36;r++)
for(s = 0;s<36;s++)
for(t = 0;t<36;t++)
for(u = 0;u<36;u++)
for(v = 0;v<36;v++)
for(w = 0;w<36;w++)
for(x = 0;x<36;x++) {
sprintf(buf,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%\n",box[a],box[b],box[c],box[d],
box[e],box[f],box[g],box[h],box[i],box[j],box[k],box[l],box[m],box[n],box[o],box[p],box[q],
box[r],box[s],box[t],box[u],box[v],box[w],box[x]);
if(validCode(buf))printf("%s",buf);
}
}
dovrebbe funzionare ma rimarrà ore senza stampare niente (soprattutto se hai un processore di media potenza) perchè per trovare un codice valido deve comunque scorrerli tutti.