Compile Error

foo.cc:26:23: warning: multi-character character constant [-Wmultichar]
   26 |                 scanf('%d',a[i]);
      |                       ^~~~
foo.cc: In function ‘int main()’:
foo.cc:26:23: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
   26 |                 scanf('%d',a[i]);
      |                       ^~~~
      |                       |
      |                       int
In file included from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/cstdio:42,
                 from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/ext/string_conversions.h:45,
                 from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/bits/basic_string.h:4154,
                 from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/string:54,
                 from /nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/bitset:52,
                 from stdc++.h:52:
/nix/glibc-2.40-66-dev/include/stdio.h:428:42: note:   initializing argument 1 of ‘int scanf(const char*, ...)’
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

信息

递交者
类型
递交
题目
P2780 小杨的幸运数字5级2 2024.6
语言
C++
递交时间
2025-07-22 19:29:53
评测时间
2025-07-22 19:29:53
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes