Submission #27248

# Submission time Handle Problem Language Result Execution time Memory
27248 2017-07-11T14:15:25 Z 검수컵(#1129) The Ethereum and The Bitcoin (FXCUP2_ethereum) C++
Compilation error
0 ms 0 KB
#include<stdio.h>
#include<stdlib.h>
#include<time.h>

char idir[55], odir[55];
int gcd(int a, int b){ return b ? gcd(b,a%b) : a; }

void gen_data(int tn){
	sprintf(idir, "mydata/%d.in", tn);
	FILE *in = fopen(idir, "wb");
	int a, b;
	if(tn == 20) a=9999, b=10000;
	else{
		a = rand()%10000+1;
		while(1){
			b=rand()%10000+1;
			if(gcd(a,b) == 1) break;
		}
	}

	fprintf(in, "fxcup!! %d %d %d\n", rand(), a, b);
}

void gen_out(int tn){
	sprintf(odir, "mydata/%d.out", tn);
	FILE *out = fopen(odir, "wb");
	fprintf(out, "aW:EJFIOVLHBAIOEHGLFJAPHEOIWEGH\n");
}

int main(){
	srand(time(NULL));
	for(int i=1; i<=20; i++) gen_data(i), gen_out(i);
	return 0;
}

Compilation message

/tmp/ccH9VnHi.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cch7bfKt.o:ethereum.cpp:(.text.startup+0x0): first defined here
/tmp/ccH9VnHi.o: In function `main':
grader.cpp:(.text.startup+0xa9): undefined reference to `GetExchangePrice()'
collect2: error: ld returned 1 exit status