Submission #1117406


Source Code Expand

#include <stdio.h>

int main(void){
	double n=1;
	scanf("%f",&n);
	for(int i=0;i<n;i++){
		n=n*i;
	}
	printf("%f\n",n%(1000000000+7));

	return 0;
}

Submission Info

Submission Time
Task B - Training Camp
User takepanhino
Language C++14 (GCC 5.4.1)
Score 0
Code Size 161 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:5:15: warning: format ‘%f’ expects argument of type ‘float*’, but argument 2 has type ‘double*’ [-Wformat=]
  scanf("%f",&n);
               ^
./Main.cpp:9:31: error: invalid operands of types ‘double’ and ‘int’ to binary ‘operator%’
  printf("%f\n",n%(1000000000+7));
                               ^
./Main.cpp:5:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%f",&n);
                ^