これで頼むわ。


#include <stdio.h>
#define FILENAME "pass.txt"
#define MAXFILESIZE (1<<29)
#define BUFSIZE (1<<20)

unsigned int rand_xor() { static unsigned int t, x=123456789UL,y=362436069UL,z=521288629UL,w=88675123UL;t=x^(x<<11); x=y; y=z; z=w; return w^=(w>>19)^t^(t>>8); }

void strgen( char *str, int &sz ) {
unsigned int x,n;
for(n=0; n<32 + rand_xor()%128 ; n+=6) {
x=rand_xor();
str[sz+n+0]='0'+x%64; x>>=6; str[sz+n+1]='0'+x%64; x>>=6;
str[sz+n+2]='0'+x%64; x>>=6; str[sz+n+3]='0'+x%64; x>>=6;
str[sz+n+4]='0'+x%64; x>>=6; str[sz+n+5]='0'+x%64; }
sz+=n; str[sz-1]='\n'; }

int main() {
FILE *fp = fopen(FILENAME, "wb");
int sum=0;
char *buf = new char [BUFSIZE+1]; int sz=0;
do{
if( sz+1024 >= BUFSIZE ) { fwrite( &buf[0], 1, sz, fp); sum+=sz; sz=0; }
strgen( buf, sz ); }while(sum < MAXFILESIZE);
fwrite( &buf[0], 1, sz, fp);
fclose(fp); }