河南工业大学信息科学与工程学院程序设计基础课件 Lecture5.pptVIP

  • 3
  • 0
  • 约4.67千字
  • 约 21页
  • 2019-05-10 发布于广东
  • 举报

河南工业大学信息科学与工程学院程序设计基础课件 Lecture5.ppt

【练习5】程序代码 #include stdio.h #include math.h int main() { int a , b , c ; int s = 0 , area = 0 ; scanf(%d%d%d,a , b , c ); if (a+bc a+cb b+ca) { s = (a + b + c) / 2.0 ; area = sqrt(s*(s-a)*(s-b)*(s-c)) ; printf(%d\n, area ) ; } return 0; } #include stdio.h 【注意】对于(1.0=x=15)问题的讨论: 执行下面程序,当对x输入20,查看输出结果。 #include stdlib.h int main(void) { double x ; printf(Enter x:); scanf(%lf, x); if ( 0 = x =15 ) printf(%.2f位于( 0 = x =15)的范围中!\n,x ); return 0; } * * * 【程序代码】 #include stdio.h #include stdlib.h int main() { char ch

文档评论(0)

1亿VIP精品文档

相关文档