int mypow(int x,int n)
{
if(n==0) return 1;
int t=1;
for(;n>0;t*=x,n--);
return t;
}
int otod(char* source,int num)
{
int ln=(int)strlen(source)-1;
int t=0;
......................
阅读全部 | 2014年11月27日 14:29
#include <stdio.h>
int main(int argc, char* argv[])
{
char* s="结果为%.2lf\n";
int a=1199;
int b=3;
double c=0.0;
_asm
{
fld a;
......................
阅读全部 | 2014年11月26日 14:17
#include <stdio.h>
//利用泰勒公式计算星期几
//w=y+[y/4]+[c/4]-2c+[26(m+1)/10]+d-1
int getweek(int year,int month,int day)
{
int w; //星期
int c; //世纪-1 YYYY的头两位
int y; //年份 YYYY的后两位
int m; //月份 >=3 1月 2月看成上年的13月 14月
int d=day; //日
if(month>=3)
......................
阅读全部 | 2014年8月18日 10:35
1、在开始-运行里输入regsvr32 jscript.dll回车,再输入regsvr32 vbscript.dll回车 重新启动计算机
2、如果提示“无法找到运行搜索助理需要的一个文件。您可能需要运行安装。”你首先看看C:\WINDOWS\srchasst文件夹下文件有没有丢失,在这个文件夹下有两个文件夹:chars和mui,四个文件:msgr3en.dll`nls302en.lex,srchctls.dll,srchui.dll。你然后打开文件夹“C:\Windows\inf”,找到“srchasst.inf”文件,用鼠标单击右键,在弹出菜单中选择“安装”;若不行,你试着运行注册表,找到“HKEY_CURRENT_
USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState”,新建字符串“Use Search Asst”,设置其值为“NO”。
阅读全部 | 2014年7月16日 09:13
去掉最后一位 | (101101->10110) | x shr 1
在最后加一个0 | (101101->1011010) | x shl 1
在最后加一个1 | (101101->1011011) | x shl 1+1
把最后一位变成1 | (101100->101101) | x or 1
把最后一位变成0 | (101101->101100) | x or 1-1
最后一位取反 | (101101->101100) | x xor 1
把右数第k位变成1 | (101001->101101,k=3) | x or (1 shl (k-1))
把右数第k位变成0 | (101101->101001,k=3) | x and not (1 shl (k-1))
右数第k位取反 | (101001->101101,k=3) | x xor (1 shl (k-1))
取末三位 | (1101101->101) | x and 7
取末k位 | (1101101->1101,k=5) | x and (1 shl k-1)
取右数第k位 | (1101101->1,k=4) | x shr (k-1) and 1
......................
阅读全部 | 2014年6月9日 13:04
#include <stdio.h>
#include <string.h>
void add(char a[],char b[],char c[])
{
char bas[]={'A','B','C','D','E','F'};
int flag=0;
int tmp,tmp2;
int lena=strlen(a)-1;
int lenb=strlen(b)-1;
int lenc=31;
c[lenc]='\0';
......................
阅读全部 | 2014年6月2日 15:17
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <malloc.h>
//程序目的:随机排座位
int main(void)
{
srand((unsigned)time(NULL));
int sum=0;
printf("请输入学生总人数:");
scanf("%d",&sum);
......................
阅读全部 | 2014年5月28日 16:57
1、故障现象:当把公共控件拖到对话框时,使用DialogBox对话框不显示
公共控件包含以下:
Slider Control 、 Tree Control 、 Date Time Picker
Spin Control 、 Progress Control Animation Control
IP Address Control 、 Rich Edit Control 、 Extended Combo Box
List Control 、 Rich Edit 2.0Control 、 CustomControl
2、产生此现象的原因,需要初始化com
3、解决步骤
①、包含头文件 #include <commctrl.h>
......................
阅读全部 | 2014年5月26日 11:19
#include <stdio.h>
#include <malloc.h>
int main()
{
int *ptable;
int n,i,j;
printf("请输入待填充的行列数:\n");
scanf("%d",&n);
ptable=(int*)malloc(sizeof(int)*n*n); //申请空间
for(i=0;i<n*n;i++) *(ptable+i)=0; //初始化
for(i=0; i<n;i++) //先填充二维数组
......................
阅读全部 | 2014年5月8日 10:16
#include <stdio.h>
#include <windows.h>
#include <string.h>
#import "c:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF") //引入ADO库
int main(void)
{
_ConnectionPtr m_pConnection=NULL;
CoInitialize(NULL); //初始化com库
HRESULT hr = m_pConnection.CreateInstance("ADODB.Connection"); //创建Connection对象
if(SUCCEEDED(hr)) //创建数据库connection对象成功
......................
阅读全部 | 2014年5月5日 11:33