记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:36:27: error: ‘int Vector3::x’ is private within this context
   36 |                 cin >> v1.x >> v1.y >> v1.z;
      |                           ^
foo.cc:7:13: note: declared private here
    7 |         int x, y, z;
      |             ^
foo.cc:36:35: error: ‘int Vector3::y’ is private within this context
   36 |                 cin >> v1.x >> v1.y >> v1.z;
      |                                   ^
foo.cc:7:16: note: declared private here
    7 |         int x, y, z;
      |                ^
foo.cc:36:43: error: ‘int Vector3::z’ is private within this context
   36 |                 cin >> v1.x >> v1.y >> v1.z;
      |                                           ^
foo.cc:7:19: note: declared private here
    7 |         int x, y, z;
      |                   ^
foo.cc:37:27: error: ‘int Vector3::x’ is private within this context
   37 |                 cin >> v2.x >> v2.y >> v2.z;
      |                           ^
foo.cc:7:13: note: declared private here
    7 |         int x, y, z;
      |             ^
foo.cc:37:35: error: ‘int Vector3::y’ is private within this context
   37 |                 cin >> v2.x >> v2.y >> v2.z;
      |                                   ^
foo.cc:7:16: note: declared private here
    7 |         int x, y, z;
      |                ^
foo.cc:37:43: error: ‘int Vector3::z’ is private within this context
   37 |                 cin >> v2.x >> v2.y >> v2.z;
      |                                           ^
foo.cc:7:19: note: declared private here
    7 |         int x, y, z;
      |                   ^
foo.cc:38:27: error: ‘int Vector3::x’ is private within this context
   38 |                 cin >> v3.x >> v3.y >> v3.z;
      |                           ^
foo.cc:7:13: note: declared private here
    7 |         int x, y, z;
      |             ^
foo.cc:38:35: error: ‘int Vector3::y’ is private within this context
   38 |                 cin >> v3.x >> v3.y >> v3.z;
      |                                   ^
foo.cc:7:16: note: declared private here
    7 |         int x, y, z;
      |                ^
foo.cc:38:43: error: ‘int Vector3::z’ is private within this context
   38 |                 cin >> v3.x >> v3.y >> v3.z;
      |                                           ^
foo.cc:7:19: note: declared private here
    7 |         int x, y, z;
      |                   ^

信息

递交者
类型
自测
题目
P1017 OO4-1 向量类的算术运算符的重载
语言
C++
递交时间
2024-04-04 21:35:36
评测时间
2024-04-04 21:35:36
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes