板块漂移
  • 板块灌水区
  • 楼主Xlon_WU
  • 当前回复6
  • 已保存回复6
  • 发布时间2024/1/9 22:34
  • 上次更新2024/1/10 14:08:28
查看原帖
板块漂移
958002
Xlon_WU楼主2024/1/9 22:34
#include <iostream>
#include <cmath>
using namespace std;
double x1,y1,x2,y2,x3,y3;
int main(){
	cin>>x1>>y1>>x2>>y2>>x3>>y3;
	printf("%.2lf\n",abs((x1-x3)*(y1-y3)-(x2-x3)*(y2-y3))/2);
	return 0;
}

本地编译通过,洛谷上编译失败。

提交记录

编译信息:

/tmp/compiler_ysmtdl0s/src:4:11: 错误:‘double y1’ redeclared as different kind of entity
    4 | double x1,y1,x2,y2,x3,y3;
      |           ^~
In file included from /nix/store/x8lqlydsxbrwvf6p7v18gws8kn1xl37f-glibc-2.38-23-dev/include/features.h:503,
                 from /nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/x86_64-unknown-linux-gnu/bits/os_defines.h:39,
                 from /nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/x86_64-unknown-linux-gnu/bits/c++config.h:679,
                 from /nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/bits/requires_hosted.h:31,
                 from /nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/iostream:38,
                 from /tmp/compiler_ysmtdl0s/src:1:
/nix/store/x8lqlydsxbrwvf6p7v18gws8kn1xl37f-glibc-2.38-23-dev/include/bits/mathcalls.h:224:1: 附注:previous declaration ‘double y1(double)’
  224 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
/tmp/compiler_ysmtdl0s/src: In function ‘int main()’:
/tmp/compiler_ysmtdl0s/src:6:16: 错误:no match for ‘operator>>’ (operand types are ‘std::basic_istream<char>::__istream_type’ {aka ‘std::basic_istream<char>’} and ‘double(double) noexcept’ {aka ‘double(double)’})
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |         ~~~~~~~^~~~
      |            |     |
      |            |     double(double) noexcept {aka double(double)}
      |            std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/iostream:42:
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:325:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  325 |       operator>>(void*& __p)
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:325:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘void*’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(void*)y1’绑定到‘void*&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:201:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  201 |       operator>>(unsigned long long& __n)
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:201:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘long long unsigned int’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(long long unsigned int)y1’绑定到‘long long unsigned int&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:197:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  197 |       operator>>(long long& __n)
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:197:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘long long int’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(long long int)y1’绑定到‘long long int&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:192:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  192 |       operator>>(unsigned long& __n)
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:192:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘long unsigned int’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(long unsigned int)y1’绑定到‘long unsigned int&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:188:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  188 |       operator>>(long& __n)
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:188:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘long int’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(long int)y1’绑定到‘long int&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:184:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  184 |       operator>>(unsigned int& __n)
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:184:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘unsigned int’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(unsigned int)y1’绑定到‘unsigned int&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:181:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]’ (near match)
  181 |       operator>>(int& __n);
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:181:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘int’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(int)y1’绑定到‘int&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:177:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match)
  177 |       operator>>(unsigned short& __n)
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:177:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘short unsigned int’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(short unsigned int)y1’绑定到‘short unsigned int&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:174:7: 附注:candidate: ‘std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]’ (near match)
  174 |       operator>>(short& __n);
      |       ^~~~~~~~
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:174:7: 附注:  conversion of argument 1 would be ill-formed:
/tmp/compiler_ysmtdl0s/src:6:18: 错误:invalid conversion from ‘double (*)(double) noexcept’ {aka ‘double (*)(double)’} to ‘short int’ [-fpermissive]
    6 |         cin>>x1>>y1>>x2>>y2>>x3>>y3;
      |                  ^~
      |                  |
      |                  double (*)(double) noexcept {aka double (*)(double)}
/tmp/compiler_ysmtdl0s/src:6:18: 错误:无法将右值‘(short int)y1’绑定到‘short int&’
/nix/store/al0w33yvyzkjm86ndpf42knjfymfisph-luogu-gcc-13.2.0/include/c++/13.2.0/istream:170
...
2024/1/9 22:34
加载中...