codice:#include <stdlib.h>#include <stdio.h> #include <ctime> using namespace std; int main () { FILE * fd; int n,i; char c; fd = fopen("Password.txt","w"); cout<<"Inserire numeri di cifre della password: "; cin>>n; srand(time(NULL)); while(i<n) { c=33+(rand() % 100000 ); if ((c>=48 && c<=57)||(c>=65 && c<=90) || (c>=97 && c<=122)) { cout<<c; i++; } } fprintf (fd,"%d %d ",c); fflush(stdin); getchar(); return 0; }


Rispondi quotando