Main.cc: In function ‘double pi(int)’:
Main.cc:7:6: error: invalid operands of types ‘double(int)’ and ‘__gnu_cxx::__promote_2::__type {aka double}’ to binary ‘operator+’
pi += pow(-1,i)/(2*i+1);
~~~^~~~~~~~~~~~~~~~~~~~
Main.cc:7:25: error: in evaluation of ‘operator+=(double(int), __gnu_cxx::__promote_2::__type {aka double})’
pi += pow(-1,i)/(2*i+1);
^
Main.cc: In function ‘int main()’:
Main.cc:15:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%ld", &n);
~~~~~^~~~~~~~~~~