foo.c:1:20: warning: extra tokens at end of #include directive
#include <stdio.h> int main() { int n, m; int num[110]; int opt, l, r, v; scanf("%d%d", &n, &m); for (int i = 1; i <= n; i ++ ) { scanf("%d", &num[i]); }for (int i = 1; i <= m; i ++ ) { scanf("%d", &opt); if (opt == 1) { scanf("%d%d%d", &l, &r, &v); for (int j = l; j <= r; j ++ ) { num[j] += v; } }if (opt == 2) { int ans = 0; scanf("%d%d", &l, &r); for (int j = l; j <= r; j ++ ) { ans += num[j]; }printf("%d\n", ans); } }return 0; }
^~~
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
[Hydro](https://hydro.ac)提供评测服务