foo.c: In function 'main':
foo.c:6:17: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
6 | scanf("%d",n);
| ~^ ~
| | |
| | int
| int *
foo.c:7:13: warning: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
7 | printf(n-1);
| ~^~
| |
| int
In file included from foo.c:1:
/nix/store/3w4yrspgcx1z9wi18rv0hbap4jjlhx4c-glibc-2.37-8-dev/include/stdio.h:356:43: note: expected 'const char * restrict' but argument is of type 'int'
356 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
foo.c:6:9: warning: 'n' is used uninitialized [-Wuninitialized]
6 | scanf("%d",n);
| ^~~~~~~~~~~~~
foo.c:5:13: note: 'n' was declared here
5 | int n;
| ^
[Hydro](https://hydro.ac)提供评测服务