#include<stdio.h>
main()
{
double s=1,b=0;
int n,i,j;
scanf("%d",&n);
for(i=1;i<=n;++i){
for(j=1;j<=i;++j)
{
s=1.0/(s*i);}
b=s+b;
}
......................
阅读全部
|
天衣boy
贴于 2017年1月12日 22:01
hide
bbsi
#include<stdio.h>
#include<string.h>
#include"pcap.h"
#include"Packet32.h"
#pragma pack(1) //按一个字节内存对齐
#define IPTOSBUFFERS 12
#define ETH_ARP 0x0806 //以太网帧类型表示后面数据的类型,对于ARP请求或应答来说,该字段的值为0x0806
#define ARP_HARDWARE 1 //硬件类型字段值表示以太网地址
#define ETH_IP 0x0800 //协议类型字段表示要映射的协议地址,类型值为0x0800表示IP地址
#define ARP_REQUEST 1
#define ARP_REPLY 2
#define HOSTNUM 255
......................
阅读全部
|
sumoer
贴于 2017年1月12日 09:29
hide
bbsi
#include <stdio.h>
long fun(int n);
int main()
{
int m;
scanf("%d", &m);
printf("The result is %ld\n", fun(m));
return 0;
}
long fun(int n)
{
int i,result=1;
......................
阅读全部
|
天昊大师
贴于 2017年1月7日 09:37
hide
bbsi
#include <stdio.h>
#include <string.h>
int max_len(char *s[],int n)
{
char *t;
int i;
t=s[0];
for(i=1;i<n;i++){
if(strlen(s[i])>strlen(t)){
t=s[i];
}
}
......................
阅读全部
|
天衣boy
贴于 2017年1月6日 08:57
hide
bbsi
#include <stdio.h>
int main()
{
int n;
FILE *pf = fopen("1.txt", "w+");
if (!pf)
{
puts("open file error!");
return -1;
}
while (true)
......................
阅读全部
|
天衣boy
贴于 2017年1月6日 08:24
hide
bbsi
#include<stdio.h>
int main()
{
char *pMonth[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
int n;
scanf("%d", &n);
if (n < 1 || n > 12)
{
printf("月份输入错误!\n");
}
else
{
......................
阅读全部
|
天衣boy
贴于 2017年1月5日 21:07
hide
bbsi
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int m;//记录字符串长度
int n;//记录字符串中的字符种类数
char map[256];//记录是哪几种字符
int count[256];//记录每种字符有多少个
int stack[1000];//递归用的栈,并记录当前生成的排列
void Make_Map(char *str) {//统计字符串的相关信息
int s[256];
int i;
memset(s,0,sizeof(s));
......................
阅读全部
|
天衣boy
贴于 2017年1月4日 21:20
hide
bbsi
#include<stdio.h>
void printf1(void);
void printf2(void);
int main(void)
{
printf1();
printf1();
printf1();
printf2();
return(0);
......................
阅读全部
|
军儿哥
贴于 2017年1月3日 14:30
hide
bbsi
/*
This program shows the 3 dimensional model of the finite
element mesh for brick elements.
Last Update 12/4/06
SLFFEA source file
Version: 1.5
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 San Le
The source code contained in this file is released under the
terms of the GNU Library General Public License.
......................
阅读全部
|
小强VS小明
贴于 2017年1月2日 15:00
hide
bbsi
#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++)
{
......................
阅读全部
|
wp231957
贴于 2016年12月29日 21:28
hide
bbsi