@echo off
:loop
rand.exe > data.in
std.exe < data.in > std.out
my.exe < data.in > my.out
fc my.out std.out
if not errorlevel 1 goto loop
pause
goto loop
#include <iostream>
#include <stdio.h>
#include <time.h>
#include<stdlib.h>
using namespace std;
const char CCH[]="abcdefghijklmnopqrstuvwxyz";
char s[111][1111];
int main()
{
int n,k[111],g;
srand((int)time(0));
n=1+rand()%100;
for(g=0;g<n;g++)
{
int i,j;
srand((int)time(NULL));
k[g]=1+rand()%10;
int m=20/k[g];
srand((unsigned)time(NULL));
for(i=0;i<m;i++)
{
for(j=1;j<=k[g];j++)
{
//srand((unsigned)time(NULL));
int x = rand() / (RAND_MAX / (sizeof(CCH) - 1));
s[g][i*k[g]+j]=CCH[x];
}
}
}
printf("%d\n",n);
for(g=0;g<n;g++)
{
printf("%d %s\n",k[g],s[g]+1);
}
return 0;
}