C语言实现四舍五入取整数

#include<stdio.h> int main() { double s; int m; scanf("%lf",&s) ; m=(int)(s+0.5); printf("%d\n",m); return 0; }
相关文章
相关标签/搜索