标签:style int div stat floor clu span ring public
JAVA:
Math.ceil()
Math.floor()
public class Floor { public static void main(String[] args) { int a = 5; int b = 6; System.out.println(Math.ceil(b/a)); System.out.println(Math.floor(b/a)); } }
public class Floor { public static void main(String[] args) { int a = 5; int b = 6; System.out.println(Math.ceil(b/(a + .0))); System.out.println(Math.floor(b/(a + .0))); } }
C
#include <stdio.h> #include <math.h> int main() { int a = 5; int b = 6; printf("%f\n", ceil(b/(a + .0))); printf("%f\n", floor(b/(a + .0))); printf("%f\n", ceil(b/a)); printf("%f\n", floor(b/a)); return 0; }
标签:style int div stat floor clu span ring public
原文地址:https://www.cnblogs.com/profesor/p/13053501.html