Compile Error

foo.cc: In function ‘int main()’:
foo.cc:8:9: error: ‘cin’ was not declared in this scope
    8 |         cin>>a>>b>>c;
      |         ^~~
foo.cc:3:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
    2 | #include<cmath>
  +++ |+#include <iostream>
    3 | using namespace std;
foo.cc:12:19: error: ‘sprt’ was not declared in this scope; did you mean ‘sqrt’?
   12 |                 r=sprt(p*(p-a)*p*(p-b)*p*(p-c));
      |                   ^~~~
      |                   sqrt
foo.cc:13:17: error: ‘cout’ was not declared in this scope
   13 |                 cout<<fixed<<setprecision(2)<<r<<endl;
      |                 ^~~~
foo.cc:13:17: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
foo.cc:13:50: error: ‘endl’ was not declared in this scope
   13 |                 cout<<fixed<<setprecision(2)<<r<<endl;
      |                                                  ^~~~
foo.cc:3:1: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?
    2 | #include<cmath>
  +++ |+#include <ostream>
    3 | using namespace std;
foo.cc:16:17: error: ‘cout’ was not declared in this scope
   16 |                 cout<<"NO"<<endl;
      |                 ^~~~
foo.cc:16:17: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
foo.cc:16:29: error: ‘endl’ was not declared in this scope
   16 |                 cout<<"NO"<<endl;
      |                             ^~~~
foo.cc:16:29: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?

信息

递交者
类型
递交
题目
P1701 求三角形面积
语言
C++
递交时间
2024-05-07 21:15:54
评测时间
2024-05-07 21:15:54
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes