|
|
@ -94,85 +94,85 @@ fib(unsigned long int n)
|
|
|
|
//return 0;
|
|
|
|
//return 0;
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
main(int argc, char **argv)
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
unsigned long n = 0, r;
|
|
|
|
unsigned long n = 0, r;
|
|
|
|
scanf("%lu", &n);
|
|
|
|
scanf("%lu", &n);
|
|
|
|
FILE *f = stdout;
|
|
|
|
//FILE *f = stdout;
|
|
|
|
// unsigned long long st = get_time(), en;
|
|
|
|
// unsigned long long st = get_time(), en;
|
|
|
|
//r = fib(29);
|
|
|
|
r = fib(n);
|
|
|
|
// en = get_time();
|
|
|
|
// en = get_time();
|
|
|
|
switch(n) {
|
|
|
|
// switch(n) {
|
|
|
|
case 0: {
|
|
|
|
// case 0: {
|
|
|
|
char array[4 * 1024] = {0};
|
|
|
|
// char array[4 * 1024] = {0};
|
|
|
|
memset(array, 'a', 4 * 1024);
|
|
|
|
// memset(array, 'a', 4 * 1024);
|
|
|
|
array[4 * 1024 - 1] = 0;
|
|
|
|
// array[4 * 1024 - 1] = 0;
|
|
|
|
//printf("%s\n", array);
|
|
|
|
// //printf("%s\n", array);
|
|
|
|
fwrite(array, 1, 4 * 1024 - 1, f);
|
|
|
|
// fwrite(array, 1, 4 * 1024 - 1, f);
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
case 1: {
|
|
|
|
// case 1: {
|
|
|
|
char array[100 * 1024] = {'b'};
|
|
|
|
// char array[100 * 1024] = {'b'};
|
|
|
|
memset(array, 'b', 100 * 1024);
|
|
|
|
// memset(array, 'b', 100 * 1024);
|
|
|
|
array[100 * 1024 - 1] = 0;
|
|
|
|
// array[100 * 1024 - 1] = 0;
|
|
|
|
//printf("%s\n", array);
|
|
|
|
// //printf("%s\n", array);
|
|
|
|
fwrite(array, 1, 100 * 1024 - 1, f);
|
|
|
|
// fwrite(array, 1, 100 * 1024 - 1, f);
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
case 2: {
|
|
|
|
// case 2: {
|
|
|
|
char array[200 * 1024] = {'c'};
|
|
|
|
// char array[200 * 1024] = {'c'};
|
|
|
|
memset(array, 'c', 200 * 1024);
|
|
|
|
// memset(array, 'c', 200 * 1024);
|
|
|
|
array[200 * 1024 - 1] = 0;
|
|
|
|
// array[200 * 1024 - 1] = 0;
|
|
|
|
fwrite(array, 1, 200 * 1024 - 1, f);
|
|
|
|
// fwrite(array, 1, 200 * 1024 - 1, f);
|
|
|
|
//printf("%s\n", array);
|
|
|
|
// //printf("%s\n", array);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
case 4: {
|
|
|
|
// case 4: {
|
|
|
|
char array[400 * 1024] = {'d'};
|
|
|
|
// char array[400 * 1024] = {'d'};
|
|
|
|
memset(array, 'd', 400 * 1024);
|
|
|
|
// memset(array, 'd', 400 * 1024);
|
|
|
|
array[400 * 1024 - 1] = 0;
|
|
|
|
// array[400 * 1024 - 1] = 0;
|
|
|
|
fwrite(array, 1, 400 * 1024 - 1, f);
|
|
|
|
// fwrite(array, 1, 400 * 1024 - 1, f);
|
|
|
|
//printf("%s\n", array);
|
|
|
|
// //printf("%s\n", array);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
case 6: {
|
|
|
|
// case 6: {
|
|
|
|
char array[600 * 1024] = {'e'};
|
|
|
|
// char array[600 * 1024] = {'e'};
|
|
|
|
memset(array, 'e', 600 * 1024);
|
|
|
|
// memset(array, 'e', 600 * 1024);
|
|
|
|
array[600 * 1024 - 1] = 0;
|
|
|
|
// array[600 * 1024 - 1] = 0;
|
|
|
|
fwrite(array, 1, 600 * 1024 - 1, f);
|
|
|
|
// fwrite(array, 1, 600 * 1024 - 1, f);
|
|
|
|
//printf("%s\n", array);
|
|
|
|
// //printf("%s\n", array);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
case 8: {
|
|
|
|
// case 8: {
|
|
|
|
char array[800 * 1024] = {'f'};
|
|
|
|
// char array[800 * 1024] = {'f'};
|
|
|
|
memset(array, 'f', 800 * 1024);
|
|
|
|
// memset(array, 'f', 800 * 1024);
|
|
|
|
array[800 * 1024 - 1] = 0;
|
|
|
|
// array[800 * 1024 - 1] = 0;
|
|
|
|
fwrite(array, 1, 800 * 1024 - 1, f);
|
|
|
|
// fwrite(array, 1, 800 * 1024 - 1, f);
|
|
|
|
//printf("%s\n", array);
|
|
|
|
// //printf("%s\n", array);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
case 10:{
|
|
|
|
// case 10:{
|
|
|
|
char array[1000 * 1024] = {'g'};
|
|
|
|
// char array[1000 * 1024] = {'g'};
|
|
|
|
memset(array, 'g', 1000 * 1024);
|
|
|
|
// memset(array, 'g', 1000 * 1024);
|
|
|
|
array[1000 * 1024 - 1] = 0;
|
|
|
|
// array[1000 * 1024 - 1] = 0;
|
|
|
|
fwrite(array, 1, 1000 * 1024 - 1, f);
|
|
|
|
// fwrite(array, 1, 1000 * 1024 - 1, f);
|
|
|
|
//printf("%s\n", array);
|
|
|
|
// //printf("%s\n", array);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
default: printf("error input of n\n");
|
|
|
|
// default: printf("error input of n\n");
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
fclose(f);
|
|
|
|
//fclose(f);
|
|
|
|
//printf("%lu\n", n);
|
|
|
|
//printf("%lu\n", n);
|
|
|
|
//printf("%lu\n", r);
|
|
|
|
printf("%lu\n", r);
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|