foo.cc:31:8: warning: multi-character character constant [-Wmultichar]
31 | printf('%d',ans);
| ^~~~
foo.cc: In function 'int main()':
foo.cc:31:8: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
In file included from /usr/include/stdio.h:867,
from /usr/include/c++/9/cstdio:42,
from foo.cc:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:105:32: note: initializing argument 1 of 'int printf(const char*, ...)'
105 | printf (const char *__restrict __fmt, ...)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
foo.cc:15:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
15 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
foo.cc:18:13: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
18 | while (scanf("%d",&x),x != 0)
| ~~~~~^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务