foo.cc: In function 'int main()':
foo.cc:13:10: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
13 | printf(tmp);
| ^~~
| |
| int
In file included from /usr/include/stdio.h:867,
from foo.cc:1:
/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:13:13: warning: format not a string literal and no format arguments [-Wformat-security]
13 | printf(tmp);
| ^
foo.cc:19:10: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
19 | printf(tmp);
| ^~~
| |
| int
In file included from /usr/include/stdio.h:867,
from foo.cc:1:
/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:19:13: warning: format not a string literal and no format arguments [-Wformat-security]
19 | printf(tmp);
| ^
foo.cc:21:9: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
21 | printf(a);
| ^
| |
| int
In file included from /usr/include/stdio.h:867,
from foo.cc:1:
/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:21:10: warning: format not a string literal and no format arguments [-Wformat-security]
21 | printf(a);
| ^
foo.cc:8:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
8 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
foo.cc:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
9 | scanf("%d", &a);
| ~~~~~^~~~~~~~~~
foo.cc:12:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
12 | scanf("%d ", &tmp);
| ~~~~~^~~~~~~~~~~~~
foo.cc:18:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
18 | scanf("%d ", &tmp);
| ~~~~~^~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务