首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴wp231957的代码贴全部
#coding=utf-8
from __future__ import print_function

#利用泰勒公式计算星期几
#w=y+[y/4]+[c/4]-2c+[26(m+1)/10]+d-1 
def getweek(year,month,day):
    #w        #星期
    #c        #世纪-1 YYYY的头两位
    #y        #年份   YYYY的后两位
    #m        #月份 >=3 1月 2月看成上年的13月 14月
    #d=day    #日
    if month>=3: 
......................
阅读全部 | 2019年2月27日 15:05
from __future__ import print_function
import socket
import sys
import os

filename=sys.argv[1]
txt=open(filename,"rb+")
filesize=os.path.getsize(filename)
i=1
while i<=filesize:
  data=txt.read(1)
  print ("%4s"%str(hex(ord(data)))+' ',end='')
......................
阅读全部 | 2019年2月26日 14:00
int  main()
{
int sum[3][5]={{1,2,3,4,5},{11,22,33,44,55},{111,222,333,444,555}};
int *p=sum[0];
for(int i=0;i<3;i++)
{
for(int j=0;j<5;j++)
{
printf("%4d",*(p+i*5+j%5));
}
printf("\n");
}
......................
阅读全部 | 2018年1月11日 21:00
bool mycheck(char t[])
{
for(char *p=t;*p!='\0';p++) if(!((*p>='a' && *p<='f') || (*p>='A' && *p<='F') || (*p>='0' && *p<='9'))) return false;
return true;
}
阅读全部 | 2018年1月2日 14:46
#include <stdio.h>
#include <string.h>

int hextodec(char t[]);
int mypow(int s);

int main()
{
char t[100]={'\0'};
printf("请输入一个十六进制数:");
scanf("%s",t);
int k=hextodec(t);
......................
阅读全部 | 2018年1月2日 14:23
http://15169.myquick.org/
阅读全部 | 2017年6月23日 09:42
#include "winsock2.h" 
#include "ws2tcpip.h" 
#include "iostream"
#include "stdio.h" 
#pragma   comment(lib,"ws2_32.lib")  

/*定义IP头部数据结构*/
typedef struct _IP_HEADER
   {
 
   union
     {
......................
阅读全部 | 2017年6月19日 15:25
#include<stdio.h>
#include<malloc.h>
void Swap(int a[],int i,int j)
{
    int temp=a[i];
    a[i]=a[j];
    a[j]=temp;
}

//冒泡排序
void BubbleSorting(int a[],int len)
{
......................
阅读全部 | 2017年5月10日 09:21
#include <stdio.h>

#define N 5

void f(char* buf)
{
    if(*buf=='\0') return;
    ++buf;
    f(buf--);
    putchar(*buf);
}

......................
阅读全部 | 2017年5月10日 09:04
#include <stdio.h>
#include <windows.h>
#include <string.h>

int main()
{
    int i,j,len,k,m;
    printf("\n\n");
    char* test="Now it will copping completed: ";
    len=(int)strlen(test);
    for (i=0;i<=100;i++)
    {
......................
阅读全部 | 2016年12月29日 21:28
1 2 3 4 5 6 7 8 9 10 下一页
wp231957