All pastes #746885 Raw Edit

Untitled

public text v1 · immutable
·published 2007-10-23 15:46 UTC
rendered paste body
#include<stdio.h>
#include<stdlib.h>
#define N 1000

struct zari {

	int counter;
	int za, zb;
};

main() {

FILE *f;
struct zari z;
int i;

f=fopen("zaria.dat","wb");

if (!f) {
	printf("\nApotyxia deysmeysis mnimis!");
	return;
}

for (i=0; i<N; i++) {
	
	z.za=rand()%6+1;
	z.zb=rand()%6+1;
	z.counter=i+1;
	fwrite(&z,sizeof(struct zari),1,f);
}

fclose(f);

}