| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 92470 | 梁敖铭 | 求平方根 | C++ | Compile Error | 0 MS | 0 KB | 174 | 2024-10-05 09:20:46 |
#include <iostream> #include <cmath> int main() { double n; cin >> n; double squareRoot = sqrt(n); cout << squareRoot << endl; return 0; }
Main.cc: In function 'int main()':
Main.cc:6:1: error: 'cin' was not declared in this scope
cin >> n;
^
Main.cc:6:1: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:60:18: note: 'std::cin'
extern istream cin; /// Linked to standard input
^
Main.cc:8:9: error: 'cout' was not declared in this scope
cout << squareRoot << endl;
^
Main.cc:8:9: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:61:18: note: 'std::cout'
extern ostream cout; /// Linked to standard output
^
Main.cc:8:32: error: 'endl' was not declared in this scope
cout << squareRoot << endl;
^
Main.cc:8:32: note: suggested alternative:
In file included from /usr/include/c++/5/iostream:39:0,
from Main.cc:1:
/usr/include/c++/5/ostream:590:5: note: 'std::endl'
endl(basic_ostream<_CharT, _Traits>& __os)
^