小易准备去拜访他的朋友,他的家在0点,但是他的朋友的家在x点(x > 0),均在一条坐标轴上。小易每一次可以向前走1,2,3,4或者5步。问小易最少走多少次可以到达他的朋友的家?
思路:如果距离小于6则,一步可达,如果大于6,则先走5步
private static void calc(int n){ int count = n / 5; if(count * 5 < n){ count++; } System.out.println(count);}