首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴wp231957的代码贴全部
#include <stdio.h>
#include <string.h>
#include <malloc.h>

#define N 10

int main()
{
    char **p;
char *tmp;
int i=0,j=0;
p= (char**)malloc(N*sizeof(char*));  //给指针数组开辟内存空间
......................
阅读全部 | 2013年8月9日 21:37
#include <stdio.h>

int issh(int x)

//返回1 表示是一个素数
    if(x<=1) return 0;
    if(x>1)    for(int i=2;i<x;i++) if(x%i==0) return 0;
    return 1;
}

int main()
{
......................
阅读全部 | 2013年8月4日 11:24
#include<stdio.h>

int main()
{
int a[10][10]={0};      //最大矩阵10*10
int n=9;                //输出9*9 矩阵
    int x,y,tot;
x=0;
y=n-1;
a[x][y]=1;
    tot=1;
    while(tot<n*n)
......................
阅读全部 | 2013年8月1日 08:21
#include<windows.h>

int main()
{
SendMessage(HWND_BROADCAST,WM_SYSCOMMAND,SC_MONITORPOWER,2);
return 0;
}

HWND_BROADCAST:消息被寄送到系统的所有顶层窗口,包括无效或不可见的非自身拥有的窗口、被覆盖的窗口和弹出式窗口。消息不被寄送到子窗口。
阅读全部 | 2013年6月30日 21:19
/*
程序功能:构造一个合格的密码串
条件一、长度在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
上一页 5 6 7 8 9 10 11 12 13 14 下一页
wp231957