Main.cc: In function ‘int main()’:
Main.cc:10:12: error: expected primary-expression before ‘%’ token
scanf (%d,&k);
^
Main.cc:10:13: error: ‘d’ was not declared in this scope
scanf (%d,&k);
^
Main.cc:9:11: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf ("%d",&n);
~~~~~~^~~~~~~~~
Main.cc:12:15: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf ("%d",&a[i]);
~~~~~~^~~~~~~~~~~~