#include <time.h>
clock_t start,finish;
start=clock();
......
......
finish=clock();
printf("%.3lf\n",((double)finish-start)/1000);
阅读全部 | 2013年2月27日 19:54
for(b = e, c = f; d = b % c; b = c, c = d);
求e、f的最大公约数 c即答案
阅读全部 | 2013年2月27日 14:23
#include<stdio.h>
int i=0;
void dec2yyy(int yyy,int source,char* bin)
{
if(source==0) return;
dec2yyy(yyy,source/yyy,bin);
if((source%yyy)<10) bin[i]=(char)(source%yyy+0x30);
else bin[i]=(char)(source%yyy+0x37);
i++;
}
......................
阅读全部 | 2013年2月25日 09:36
// nongli.cpp : 定义 DLL 应用程序的导出函数。
//
#include "stdafx.h"
#include "nongli.h"
#include <string.h>
#include <stdio.h>
#include <string.h>
#define days1800 341
int nongli[]=
{
......................
阅读全部 | 2013年1月16日 16:40
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
#include "StdAfx.h"
#define days1800 341
int nongli[]=
{
/***************************************
* 农历1800-2100年大月小月与闰月 *
* (连同111个闰月在内共3723个月) *
* 公元1800-01-01为腊月(大)初七 *
......................
阅读全部 | 2013年1月13日 12:33
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
#include "StdAfx.h"
#define days1800 341
int nongli[]=
{
/***************************************
* 农历1800-2100年大月小月与闰月 *
* (连同111个闰月在内共3723个月) *
* 公元1800-01-01为腊月(大)初七 *
......................
阅读全部 | 2013年1月11日 16:03
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
#include "StdAfx.h"
#define days1800 341
int nongli[]=
{
/***************************************
* 农历1800-2100年大月小月与闰月 *
* (连同111个闰月在内共3723个月) *
* 公元1800-01-01为腊月(大)初七 *
......................
阅读全部 | 2013年1月11日 10:06
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
int nongli[]=
{
/***************************************
* 农历1800-2100年大月小月与闰月 *
* (连同111个闰月在内共3723个月) *
* 公元1800-01-01为腊月(大)初七 *
* 公元1800-01-25为农历正月初一 *
***************************************/
......................
阅读全部 | 2013年1月10日 23:05
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
#define leap(y) (y%4==0&&y%100||y%400==0)
char days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
char *xq[]={"日","一","二","三","四","五","六", "七","八","九","十","冬","腊" };
struct date{ int year,month,day; };
typedef struct
{
......................
阅读全部 | 2013年1月10日 16:27
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
公历日期与农历日期的相互转换程序
【极限范围】1800-1-25~2101-1-28
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#include<stdio.h>
#include<string.h>
#define leap(y) (y%4==0&&y%100||y%400==0)
char days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
char *xq[]={"日","一","二","三","四","五","六",
"七","八","九","十","冬","腊" };
struct date{ int year,month,day; }
d1={ 1800,1,25 },/*阴历1800正月初一*/
......................
阅读全部 | 2013年1月10日 15:48