/ Vijos /

记录详情

Compile Error

/in/foo.cc:43:5: error: stray '@' in program
     @Override
     ^
/in/foo.cc:1:1: error: 'import' does not name a type
 import java.util.*;
 ^~~~~~
/in/foo.cc:2:1: error: 'import' does not name a type
 import java.io.*;
 ^~~~~~
/in/foo.cc:3:1: error: 'import' does not name a type
 import java.lang.Math.*;
 ^~~~~~
/in/foo.cc:4:1: error: 'import' does not name a type
 import java.text.DecimalFormat;
 ^~~~~~
/in/foo.cc:6:12: error: expected ':' before 'Tree'
     public Tree left, right;
            ^~~~
/in/foo.cc:6:17: error: field 'left' has incomplete type 'Tree'
     public Tree left, right;
                 ^~~~
/in/foo.cc:5:7: note: definition of 'class Tree' is not complete until the closing brace
 class Tree {
       ^~~~
/in/foo.cc:6:23: error: field 'right' has incomplete type 'Tree'
     public Tree left, right;
                       ^~~~~
/in/foo.cc:5:7: note: definition of 'class Tree' is not complete until the closing brace
 class Tree {
       ^~~~
/in/foo.cc:7:12: error: expected ':' before 'char'
     public char value;
            ^~~~
/in/foo.cc:8:12: error: expected ':' before 'int'
     public int frequency;
            ^~~
/in/foo.cc:9:12: error: expected ':' before 'Tree'
     public Tree (char value, int frequency) {
            ^~~~
/in/foo.cc:14:13: error: expected ':' before 'void'
     private void showTreedepth(Tree t, int depth) {
             ^~~~
/in/foo.cc:23:12: error: expected ':' before 'void'
     public void showTree() {
            ^~~~
/in/foo.cc:27:12: error: expected ':' before 'void'
     public void preorder(int[] depth, int step) {
            ^~~~
/in/foo.cc:27:32: error: expected ',' or '...' before 'depth'
     public void preorder(int[] depth, int step) {
                                ^~~~~
/in/foo.cc:40:1: error: expected ';' after class definition
 }
 ^
/in/foo.cc: In constructor 'Tree::Tree(char, int)':
/in/foo.cc:10:14: error: request for member 'value' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
         this.value = value;
              ^~~~~
/in/foo.cc:11:14: error: request for member 'frequency' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
         this.frequency = frequency;
              ^~~~~~~~~
/in/foo.cc: In member function 'void Tree::showTreedepth(Tree, int)':
/in/foo.cc:15:18: error: 'null' was not declared in this scope
         if (t == null) return;
                  ^~~~
/in/foo.cc:18:38: error: 'System' was not declared in this scope
         for (i = 0 ; i < depth; i++) System.out.print("\t\t");
                                      ^~~~~~
/in/foo.cc:19:9: error: 'System' was not declared in this scope
         System.out.println("(" + t.value + ", " + t.frequency + ")");
         ^~~~~~
/in/foo.cc:19:42: error: invalid operands of types 'const char*' and 'const char [3]' to binary 'operator+'
         System.out.println("(" + t.value + ", " + t.frequency + ")");
                            ~~~~~~~~~~~~~~^~~~~~
/in/foo.cc: In member function 'void Tree::showTree()':
/in/foo.cc:24:30: error: no matching function for call to 'Tree::showTreedepth(Tree*, int)'
         showTreedepth(this, 0);
                              ^
/in/foo.cc:14:18: note: candidate: void Tree::showTreedepth(Tree, int)
     private void showTreedepth(Tree t, int depth) {
                  ^~~~~~~~~~~~~
/in/foo.cc:14:18: note:   no known conversion for argument 1 from 'Tree*' to 'Tree'
/in/foo.cc: In member function 'void Tree::preorder(int*)':
/in/foo.cc:28:21: error: 'null' was not declared in this scope
         if (this == null) return;
                     ^~~~
/in/foo.cc:29:18: error: request for member 'left' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
         if (this.left == null && this.right == null) {
                  ^~~~
/in/foo.cc:29:26: error: 'null' was not declared in this scope
         if (this.left == null && this.right == null) {
                          ^~~~
/in/foo.cc:29:39: error: request for member 'right' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
         if (this.left == null && this.right == null) {
                                       ^~~~~
/in/foo.cc:30:22: error: request for member 'value' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
             if (this.value == '_') {
                      ^~~~~
/in/foo.cc:31:17: error: 'depth' was not declared in this scope
                 depth[26] = step;
                 ^~~~~
/in/foo.cc:31:29: error: 'step' was not declared in this scope
                 depth[26] = step;
                             ^~~~
/in/foo.cc:32:29: error: request for member 'value' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
             } else if (this.value >= 'A' && this.value <= 'Z') {
                             ^~~~~
/in/foo.cc:32:50: error: request for member 'value' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
             } else if (this.value >= 'A' && this.value <= 'Z') {
                                                  ^~~~~
/in/foo.cc:33:17: error: 'depth' was not declared in this scope
                 depth[this.value - 'A'] = step;
                 ^~~~~
/in/foo.cc:33:28: error: request for member 'value' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
                 depth[this.value - 'A'] = step;
                            ^~~~~
/in/foo.cc:33:43: error: 'step' was not declared in this scope
                 depth[this.value - 'A'] = step;
                                           ^~~~
/in/foo.cc:37:14: error: request for member 'left' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
         this.left.preorder(depth, step + 1);
              ^~~~
/in/foo.cc:37:28: error: 'depth' was not declared in this scope
         this.left.preorder(depth, step + 1);
                            ^~~~~
/in/foo.cc:37:35: error: 'step' was not declared in this scope
         this.left.preorder(depth, step + 1);
                                   ^~~~
/in/foo.cc:38:14: error: request for member 'right' in '(Tree*)this', which is of pointer type 'Tree*' (maybe you meant to use '->' ?)
         this.right.preorder(depth, step + 1);
              ^~~~~
/in/foo.cc: At global scope:
/in/foo.cc:42:33: error: expected initializer before 'Comparator'
 class NodeComparator implements Comparator<Tree> {
                                 ^~~~~~~~~~

信息

递交者
类型
递交
题目
P1079 中青局
语言
C++
递交时间
2021-05-23 12:29:44
评测时间
2021-05-23 12:29:44
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes