此代码的C++中杂散'342'编译器错误

A stray '342' compiler error in C++ for this code

本文关键字:错误 编译器 代码 C++      更新时间:2023-10-16

我在程序中遇到过这种类型的' '342' ';第一次出现错误。

下面是我的代码
#include <bits/stdc++.h>
using namespace std;
#define sc(n) scanf("%d",&n)
#define tc1 cin>>t;while(t--)
#define forf(i, a, b) for(i =(a); i <(b); ++i)
int main()
{
    long long int t, x1, x2, x3, y1, y2, y3, points, temp;
    float area;
    tc1
    {
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        temp = x1*y2 + x2*y3 + x3*y1 −x1*y3 − x3*y2 − x2*y1;
        area = 0.5f * abs(temp);
        points = area + 1 - (3/2);
        cout << points << "n";
    }
    return 0;
}

下面是我的编译错误:

solution.cc:18:9: error: stray '342' in program
     temp=x1*y2 +x2*y3 + x3*y1 −x1*y3 − x3*y2 − x2*y1;
     ^
solution.cc:18:9: error: stray '210' in program
solution.cc:18:9: error: stray '222' in program
solution.cc:18:9: error: stray '342' in program
solution.cc:18:9: error: stray '210' in program
solution.cc:18:9: error: stray '222' in program
solution.cc:18:9: error: stray '342' in program
solution.cc:18:9: error: stray '210' in program
solution.cc:18:9: error: stray '222' in program
solution.cc: In function 'int main()':
solution.cc:18:38: error: expected ';' before 'x1'
     temp=x1*y2 +x2*y3 + x3*y1 −x1*y3 − x3*y2 − x2*y1;
                                  ^

这个错误是什么意思?

我无法通过之前问过的问题来理解这个错误的确切含义。

看起来你的公式中有错误的字符

temp=x1*y2 +x2*y3 + x3*y1 −x1*y3 − x3*y2 − x2*y1;

不一样
temp=x1*y2 +x2*y3 + x3*y1 -x1*y3 - x3*y2 - x2*y1;

可以看到(-)是不同的