首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴wp231957的代码贴C语言
/*
程序功能:构造一个合格的密码串
条件一、长度在8-16位(含8、16)
条件二、密码至少应该由以下4部分中的3部分组成
1、A-Z
2、a-z
3、0-9
4、!@#¥%^&
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
......................
阅读全部 | 2013年6月7日 12:28
#include <stdio.h>
#define N 15
int main ()
{
int s[N][N]={0};
int m=0,n=0;
int csh=1;
int col=0;
int row=N-1;
while(1)
{
for(m=0;m<N;m++)
......................
阅读全部 | 2013年5月6日 09:34
#include <stdio.h>
#include <string.h>
int search(char* sourcestr,char* substr)
{
if(substr==NULL) return 0;
int ret=0;
char* begin=sourcestr;
while(*begin!='\0')
{
if(strstr(begin,substr)!=NULL && begin==strstr(begin,substr)) ret++;
begin++;
}
......................
阅读全部 | 2013年3月27日 09:24
#include <stdio.h>

//指数运算
_int64 _pow(int base,int p)
{
int i=0;
_int64 ret=1;
if (p==0) return 1;
    for(i=1;i<=p;i++)
{
ret=ret*base;
}
......................
阅读全部 | 2013年3月24日 21:11
#include <stdio.h>

//获取公历年初至某整月的天数
int year_sumday(int year,int month)
{
    int sum=0;
    int rui[12]={31,29,31,30,31,30,31,31,30,31,30,31};
    int ping[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    int ruiflag=0;
    if((year%4==0 &&year%100!=0) || year%400==0) ruiflag=1;
    for(int index=0;index<month-1;index++)
    {
......................
阅读全部 | 2013年3月21日 11:01
#include <time.h>
#include <math.h>
#include <stdio.h>

int a[240] = {0};
int ss[1230] = {2, 3, 5, 7, 11, 13, 17, 19};

void Init()
{    //10000以内质数表,1229个
    int i, j, k = 8, temp;
    for (i = 23;k != 1230;i += 2)
    {
......................
阅读全部 | 2013年3月21日 10:03
int index=0;
void dec2yyy(int yyy,int source,char* bin)
{
    if(source==0) return;
    dec2yyy(yyy,source/yyy,bin);
    if((source%yyy)<10) bin[index]=(char)(source%yyy+0x30);
    else bin[index]=(char)(source%yyy+0x37);
    index++;
}
阅读全部 | 2013年3月15日 09:07
#include <stdio.h>

int main(void)
{
    _int64 dest[30000]={0};
    int index=0;
    char tmp;
    FILE* stream;
    stream = fopen("d:\\test.txt", "rb");
    if( stream == NULL )
        printf( "The file test.txt was not opened\n" );
    else
......................
阅读全部 | 2013年3月6日 14:01
#include <stdio.h>

void count_w(char* source,int* sum_num,int* sum_char,int* sum_space)
{
while(*source!='\0')
{
if(*source>='a' && *source<='z') (*sum_char)++;
if(*source>='A' && *source<='Z') (*sum_char)++;
if(*source>='0' && *source<='9') (*sum_num)++;
if(*source==0x20) (*sum_space)++;
source++;
}
......................
阅读全部 | 2013年3月6日 09:25
#include <objbase.h>
#include <stdio.h>
#pragma comment(lib,"ole32.lib")

//需要链接ole32.lib  需要引用objbase.h
const char* newGUID()
{
static char buf[64] = {0};
GUID guid;
if (S_OK ==CoCreateGuid(&guid))
{
_snprintf(buf, sizeof(buf)
......................
阅读全部 | 2013年3月4日 08:43
上一页 5 6 7 8 9 10 11 12 13 14 下一页
wp231957