#include #include using namespace std; int main() { FILE* f=fopen("tabel.txt","w"); fprintf(f,"Nr. 10 100 1000\n"); long a=0; for(int j=0;j<15;j++) for(long i=0;i<100000;i++) { switch(rand()%2) { case 0: a+=1; break; case 1: a-=1; break; } switch(i) { case 9: fprintf(f,"%d %d ",j,abs(a)); break; case 99: fprintf(f,"%d ",abs(a)); break; case 999: fprintf(f,"%d ",abs(a)); break; case 9999: fprintf(f,"%d ",abs(a)); break; case 99999: fprintf(f,"%d\n",abs(a)); a=0; break; } } }