万年历-C源码(可直接在VC6.0下运行) please select the service you need//用来提示选择执行功能 Search what day is today//用来计算这一天是星期几 Search whether the year is leap year or not//计算是否闰年 Print the calander of the whole year//输出全年的日历 Print the calander of serveral years//输出连续几年
二分查找是一种非常常见的算法,在面试时会经常被问到。其输入是一个有序的数组,输出需要查找数字的下标(注意输入一定是有序的)。
先说一下最基本的,有序数组中没有重复的元素。
public class binarySearchTest {
public static void main(String[] args) {
int[]num=new int[]{1,4,6,7,9,10,14,18,19,27,30};///初始数组一定是有序的
int ke