1 #include <stdio.h>
 2 
 3 int square137(int n);
 4 
 5 void p137() {
 6     double x = 3.0;
 7     int y = (int)x;
 8     printf("Square of %f is %d\n", x, square137(y));
 9 }
10 
11 int square137(int n) {
12     return n * n;
13 }

如果你吧%f改为%lf的话,输出就会出乎你的意料,试试便知

相关文章:

  • 2022-12-23
  • 2021-12-02
  • 2021-06-22
  • 2021-09-28
  • 2021-12-16
  • 2021-06-30
  • 2021-12-14
  • 2021-11-10
猜你喜欢
  • 2021-08-11
  • 2021-10-10
  • 2022-12-23
  • 1970-01-01
  • 1970-01-01
  • 2022-12-23
  • 2022-02-02
相关资源
相似解决方案