Compile Error

foo.cc: In function ‘bool cmp(Node, Node)’:
foo.cc:10:41: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
   10 |         return x.num<y.num||x.num==y.num&&x.id<y.id;
      |                             ~~~~~~~~~~~~^~~~~~~~~~~
foo.cc: In function ‘int read()’:
foo.cc:16:15: error: ‘ch’ was not declared in this scope; did you mean ‘c’?
   16 |         while(ch<'0'||ch>'9')
      |               ^~
      |               c
foo.cc:21:15: error: ‘ch’ was not declared in this scope; did you mean ‘c’?
   21 |         while(ch>='0'&&ch<='9')
      |               ^~
      |               c
foo.cc:15:14: warning: unused variable ‘c’ [-Wunused-variable]
   15 |         char c=getchar();
      |              ^
foo.cc: In function ‘void read(int)’:
foo.cc:35:21: error: too few arguments to function ‘ssize_t write(int, const void*, size_t)’
   35 |         if(x>9)write(x/10);
      |                ~~~~~^~~~~~
In file included from /nix/glibc-2.40-66-dev/include/bits/sigstksz.h:24,
                 from /nix/glibc-2.40-66-dev/include/signal.h:328,
                 from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/csignal:42,
                 from stdc++.h:116:
/nix/glibc-2.40-66-dev/include/unistd.h:378:16: note: declared here
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
foo.cc: In function ‘int main()’:
foo.cc:67:46: error: too few arguments to function ‘ssize_t write(int, const void*, size_t)’
   67 |                                         write(x);puts("");break;
      |                                         ~~~~~^~~
/nix/glibc-2.40-66-dev/include/unistd.h:378:16: note: declared here
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~

信息

递交者
类型
递交
题目
P2433 插入排序
语言
C++
递交时间
2025-07-19 13:32:15
评测时间
2025-07-19 13:32:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes