Main.cc: In function ‘int main()’: Main.cc:6:18: warning: too many arguments for format [-Wformat-extra-args] scanf("%d",&n,&m); ^ Main.cc:8:2: error: ‘i’ was not declared in this scope i++; ^ Main.cc:6:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&n,&m); ~~~~~^~~~~~~~~~~~