foo.cc: In function 'int main()':
foo.cc:14:12: warning: unused variable 'j' [-Wunused-variable]
int i, j, k;
^
foo.cc:14:15: warning: unused variable 'k' [-Wunused-variable]
int i, j, k;
^
foo.cc:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
foo.cc:23:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &x, &y);
~~~~~^~~~~~~~~~~~~~~~
foo.cc:42:17: warning: 'y2' may be used uninitialized in this function [-Wmaybe-uninitialized]
y = (y1 + y2) / 2; //两个数中间的任意数值均可,因此无需求实数的平均数
~~~~^~~~~
foo.cc:42:17: warning: 'y1' may be used uninitialized in this function [-Wmaybe-uninitialized]