1.des算法源代码
2.请使用C#编写一个函数,要求返回小于给定整数的所有正奇数之和。
3.HTML5代码里能怎么才能写jsp代码
4.编写函数int old(int n)判断n是否为奇数,若是58搜源码,则返回1,否则返回0
5.求频率细化分析zoomfft的当当商城源码C++源代码
des算法源代码
des.h文件:
#ifndef CRYPTOPP_DES_H
#define CRYPTOPP_DES_H
#include "cryptlib.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
class DES : public BlockTransformation
{
public:
DES(const byte *userKey, CipherDir);
void ProcessBlock(const byte *inBlock, byte * outBlock) const;
void ProcessBlock(byte * inoutBlock) const
{ DES::ProcessBlock(inoutBlock, inoutBlock);}
enum { KEYLENGTH=8, BLOCKSIZE=8};
unsigned int BlockSize() const { return BLOCKSIZE;}
protected:
static const word Spbox[8][];
SecBlock<word> k;
};
class DESEncryption : public DES
{
public:
DESEncryption(const byte * userKey)
: DES (userKey, ENCRYPTION) { }
};
class DESDecryption : public DES
{
public:
DESDecryption(const byte * userKey)
: DES (userKey, DECRYPTION) { }
};
class DES_EDE_Encryption : public BlockTransformation
{
public:
DES_EDE_Encryption(const byte * userKey)
: e(userKey, ENCRYPTION), d(userKey + DES::KEYLENGTH, DECRYPTION) { }
void ProcessBlock(const byte *inBlock, byte * outBlock) const;
void ProcessBlock(byte * inoutBlock) const;
enum { KEYLENGTH=, BLOCKSIZE=8};
unsigned int BlockSize() const { return BLOCKSIZE;}
private:
DES e, d;
};
class DES_EDE_Decryption : public BlockTransformation
{
public:
DES_EDE_Decryption(const byte * userKey)
: d(userKey, DECRYPTION), e(userKey + DES::KEYLENGTH, ENCRYPTION) { }
void ProcessBlock(const byte *inBlock, byte * outBlock) const;
void ProcessBlock(byte * inoutBlock) const;
enum { KEYLENGTH=, BLOCKSIZE=8};
unsigned int BlockSize() const { return BLOCKSIZE;}
private:
DES d, e;
};
class TripleDES_Encryption : public BlockTransformation
{
public:
TripleDES_Encryption(const byte * userKey)
: e1(userKey, ENCRYPTION), d(userKey + DES::KEYLENGTH, DECRYPTION),
e2(userKey + 2*DES::KEYLENGTH, ENCRYPTION) { }
void ProcessBlock(const byte *inBlock, byte * outBlock) const;
void ProcessBlock(byte * inoutBlock) const;
enum { KEYLENGTH=, BLOCKSIZE=8};
unsigned int BlockSize() const { return BLOCKSIZE;}
private:
DES e1, d, e2;
};
class TripleDES_Decryption : public BlockTransformation
{
public:
TripleDES_Decryption(const byte * userKey)
: d1(userKey + 2*DES::KEYLENGTH, DECRYPTION), e(userKey + DES::KEYLENGTH, ENCRYPTION),
d2(userKey, DECRYPTION) { }
void ProcessBlock(const byte *inBlock, byte * outBlock) const;
void ProcessBlock(byte * inoutBlock) const;
enum { KEYLENGTH=, BLOCKSIZE=8};
unsigned int BlockSize() const { return BLOCKSIZE;}
private:
DES d1, e, d2;
};
NAMESPACE_END
#endif
des.cpp文件:
// des.cpp - modified by Wei Dai from:
/*
* This is a major rewrite of my old public domain DES code written
* circa , which in turn borrowed heavily from Jim Gillogly's
* public domain code. I pretty much kept my key scheduling code, but
* the actual encrypt/decrypt routines are taken from from Richard
* Outerbridge's DES code as printed in Schneier's "Applied Cryptography."
*
* This code is in the public domain. I would appreciate bug reports and
* enhancements.
*
* Phil Karn KA9Q, karn@unix.ka9q.ampr.org, August .
*/
#include "pch.h"
#include "misc.h"
#include "des.h"
NAMESPACE_BEGIN(CryptoPP)
/* Tables defined in the Data Encryption Standard documents
* Three of these tables, the initial permutation, the final
* permutation and the expansion operator, are regular enough that
* for speed, we hard-code them. They're here for reference only.
* Also, the S and P boxes are used by a separate program, gensp.c,
* to build the combined SP box, Spbox[]. They're also here just
* for reference.
*/
#ifdef notdef
/* initial permutation IP */
static byte ip[] = {
, , , , , , , 2,
, , , , , , , 4,
, , , , , , , 6,
, , , , , , , 8,
, , , , , , 9, 1,
, , , , , , , 3,
, , , , , , , 5,
, , , , , , , 7
};
/* final permutation IP^-1 */
static byte fp[] = {
, 8, , , , , , ,
, 7, , , , , , ,
, 6, , , , , , ,
, 5, , , , , , ,
, 4, , , , , , ,
, 3, , , , , , ,
, 2, , , , , , ,
, 1, , 9, , , ,
};
/* expansion operation matrix */
static byte ei[] = {
, 1, 2, 3, 4, 5,
4, 5, 6, 7, 8, 9,
8, 9, , , , ,
, , , , , ,
, , , , , ,
, , , , , ,
, , , , , ,
, , , , , 1
};
/* The (in)famous S-boxes */
static byte sbox[8][] = {
/* S1 */
, 4, , 1, 2, , , 8, 3, , 6, , 5, 9, 0, 7,
0, , 7, 4, , 2, , 1, , 6, , , 9, 5, 3, 8,
4, 1, , 8, , 6, 2, , , , 9, 7, 3, , 5, 0,
, , 8, 2, 4, 9, 1, 7, 5, , 3, , , 0, 6, ,
/* S2 */
, 1, 8, , 6, , 3, 4, 9, 7, 2, , , 0, 5, ,
3, , 4, 7, , 2, 8, , , 0, 1, , 6, 9, , 5,
0, , 7, , , 4, , 1, 5, 8, , 6, 9, 3, 2, ,
, 8, , 1, 3, , 4, 2, , 6, 7, , 0, 5, , 9,
/* S3 */
, 0, 9, , 6, 3, , 5, 1, , , 7, , 4, 2, 8,
, 7, 0, 9, 3, 4, 6, , 2, 8, 5, , , , , 1,
, 6, 4, 9, 8, , 3, 0, , 1, 2, , 5, , , 7,
1, , , 0, 6, 9, 8, 7, 4, , , 3, , 5, 2, ,
/* S4 */
7, , , 3, 0, 6, 9, , 1, 2, 8, 5, , , 4, ,
, 8, , 5, 6, , 0, 3, 4, 7, 2, , 1, , , 9,
, 6, 9, 0, , , 7, , , 1, 3, , 5, 2, 8, 4,
3, , 0, 6, , 1, , 8, 9, 4, 5, , , 7, 2, ,
/* S5 */
2, , 4, 1, 7, , , 6, 8, 5, 3, , , 0, , 9,
, , 2, , 4, 7, , 1, 5, 0, , , 3, 9, 8, 6,
4, 2, 1, , , , 7, 8, , 9, , 5, 6, 3, 0, ,
, 8, , 7, 1, , 2, , 6, , 0, 9, , 4, 5, 3,
/* S6 */
, 1, , , 9, 2, 6, 8, 0, , 3, 4, , 7, 5, ,
, , 4, 2, 7, , 9, 5, 6, 1, , , 0, , 3, 8,
9, , , 5, 2, 8, , 3, 7, 0, 4, , 1, , , 6,
4, 3, 2, , 9, 5, , , , , 1, 7, 6, 0, 8, ,
/* S7 */
4, , 2, , , 0, 8, , 3, , 9, 7, 5, , 6, 1,
, 0, , 7, 4, 9, 1, , , 3, 5, , 2, , 8, 6,
1, 4, , , , 3, 7, , , , 6, 8, 0, 5, 9, 2,
6, , , 8, 1, 4, , 7, 9, 5, 0, , , 2, 3, ,
/* S8 */
, 2, 8, 4, 6, , , 1, , 9, 3, , 5, 0, , 7,
1, , , 8, , 3, 7, 4, , 5, 6, , 0, , 9, 2,
7, , 4, 1, 9, , , 2, 0, 6, , , , 3, 5, 8,
2, 1, , 7, 4, , 8, , , , 9, 0, 3, 5, 6,
};
/* -bit permutation function P used on the output of the S-boxes */
static byte pi[] = {
, 7, , ,
, , , ,
1, , , ,
5, , , ,
2, 8, , ,
, , 3, 9,
, , , 6,
, , 4,
};
#endif
/* permuted choice table (key) */
static const byte pc1[] = {
, , , , , , 9,
1, , , , , , ,
, 2, , , , , ,
, , 3, , , , ,
, , , , , , ,
7, , , , , , ,
, 6, , , , , ,
, , 5, , , , 4
};
/* number left rotations of pc1 */
static const byte totrot[] = {
1,2,4,6,8,,,,,,,,,,,
};
/* permuted choice key (table) */
static const byte pc2[] = {
, , , , 1, 5,
3, , , 6, , ,
, , , 4, , 8,
, 7, , , , 2,
, , , , , ,
, , , , , ,
, , , , , ,
, , , , ,
};
/* End of DES-defined tables */
/* bit 0 is left-most in byte */
static const int bytebit[] = {
,,,,,,,
};
/* Set key (initialize key schedule array) */
DES::DES(const byte *key, CipherDir dir)
: k()
{
SecByteBlock buffer(++8);
byte *const pc1m=buffer; /* place to modify pc1 into */
byte *const pcr=pc1m+; /* place to rotate pc1 into */
byte *const ks=pcr+;
register int i,j,l;
int m;
for (j=0; j<; j++) { /* convert pc1 to bits of key */
l=pc1[j]-1; /* integer bit location */
m = l & ; /* find bit */
pc1m[j]=(key[l>>3] & /* find which key byte l is in */
bytebit[m]) /* and which bit of that byte */
1 : 0; /* and store 1-bit result */}
for (i=0; i<; i++) { /* key chunk for each iteration */
memset(ks,0,8); /* Clear key schedule */
for (j=0; j<; j++) /* rotate pc1 the right amount */
pcr[j] = pc1m[(l=j+totrot[i])<(j<? : ) ? l: l-];
/* rotate left and right halves independently */
for (j=0; j<; j++){ /* select bits individually */
/* check bit that goes to ks[j] */
if (pcr[pc2[j]-1]){
/* mask it in if it's there */
l= j % 6;
ks[j/6] |= bytebit[l] >> 2;
}
}
/* Now convert to odd/even interleaved form for use in F */
k[2*i] = ((word)ks[0] << )
| ((word)ks[2] << )
| ((word)ks[4] << 8)
| ((word)ks[6]);
k[2*i+1] = ((word)ks[1] << )
| ((word)ks[3] << )
| ((word)ks[5] << 8)
| ((word)ks[7]);
}
if (dir==DECRYPTION) // reverse key schedule order
for (i=0; i<; i+=2)
{
std::swap(k[i], k[-2-i]);
std::swap(k[i+1], k[-1-i]);
}
}
/* End of C code common to both versions */
/* C code only in portable version */
// Richard Outerbridge's initial permutation algorithm
/*
inline void IPERM(word &left, word &right)
{
word work;
work = ((left >> 4) ^ right) & 0x0f0f0f0f;
right ^= work;
left ^= work << 4;
work = ((left >> ) ^ right) & 0xffff;
right ^= work;
left ^= work << ;
work = ((right >> 2) ^ left) & 0x;
left ^= work;
right ^= (work << 2);
work = ((right >> 8) ^ left) & 0xffff;
left ^= work;
right ^= (work << 8);
right = rotl(right, 1);
work = (left ^ right) & 0xaaaaaaaa;
left ^= work;
right ^= work;
left = rotl(left, 1);
}
inline void FPERM(word &left, word &right)
{
word work;
right = rotr(right, 1);
work = (left ^ right) & 0xaaaaaaaa;
left ^= work;
right ^= work;
left = rotr(left, 1);
work = ((left >> 8) ^ right) & 0xffff;
right ^= work;
left ^= work << 8;
work = ((left >> 2) ^ right) & 0x;
right ^= work;
left ^= work << 2;
work = ((right >> ) ^ left) & 0xffff;
left ^= work;
right ^= work << ;
work = ((right >> 4) ^ left) & 0x0f0f0f0f;
left ^= work;
right ^= work << 4;
}
*/
// Wei Dai's modification to Richard Outerbridge's initial permutation
// algorithm, this one is faster if you have access to rotate instructions
// (like in MSVC)
inline void IPERM(word &left, word &right)
{
word work;
right = rotl(right, 4U);
work = (left ^ right) & 0xf0f0f0f0;
left ^= work;
right = rotr(right^work, U);
work = (left ^ right) & 0xffff;
left ^= work;
right = rotr(right^work, U);
work = (left ^ right) & 0x;
left ^= work;
right = rotr(right^work, 6U);
work = (left ^ right) & 0xffff;
left ^= work;
right = rotl(right^work, 9U);
work = (left ^ right) & 0xaaaaaaaa;
left = rotl(left^work, 1U);
right ^= work;
}
inline void FPERM(word &left, word &right)
{
word work;
right = rotr(right, 1U);
work = (left ^ right) & 0xaaaaaaaa;
right ^= work;
left = rotr(left^work, 9U);
work = (left ^ right) & 0xffff;
right ^= work;
left = rotl(left^work, 6U);
work = (left ^ right) & 0x;
right ^= work;
left = rotl(left^work, U);
work = (left ^ right) & 0xffff;
right ^= work;
left = rotl(left^work, U);
work = (left ^ right) & 0xf0f0f0f0;
right ^= work;
left = rotr(left^work, 4U);
}
// Encrypt or decrypt a block of data in ECB mode
void DES::ProcessBlock(const byte *inBlock, byte * outBlock) const
{
word l,r,work;
#ifdef IS_LITTLE_ENDIAN
l = byteReverse(*(word *)inBlock);
r = byteReverse(*(word *)(inBlock+4));
#else
l = *(word *)inBlock;
r = *(word *)(inBlock+4);
#endif
IPERM(l,r);
const word *kptr=k;
for (unsigned i=0; i<8; i++)
{
work = rotr(r, 4U) ^ kptr[4*i+0];
l ^= Spbox[6][(work) & 0x3f]
^ Spbox[4][(work >> 8) & 0x3f]
^ Spbox[2][(work >> ) & 0x3f]
^ Spbox[0][(work >> ) & 0x3f];
work = r ^ kptr[4*i+1];
l ^= Spbox[7][(work) & 0x3f]
^ Spbox[5][(work >> 8) & 0x3f]
^ Spbox[3][(work >> ) & 0x3f]
^ Spbox[1][(work >> ) & 0x3f];
work = rotr(l, 4U) ^ kptr[4*i+2];
r ^= Spbox[6][(work) & 0x3f]
^ Spbox[4][(work >> 8) & 0x3f]
^ Spbox[2][(work >> ) & 0x3f]
^ Spbox[0][(work >> ) & 0x3f];
work = l ^ kptr[4*i+3];
r ^= Spbox[7][(work) & 0x3f]
^ Spbox[5][(work >> 8) & 0x3f]
^ Spbox[3][(work >> ) & 0x3f]
^ Spbox[1][(work >> ) & 0x3f];
}
FPERM(l,r);
#ifdef IS_LITTLE_ENDIAN
*(word *)outBlock = byteReverse(r);
*(word *)(outBlock+4) = byteReverse(l);
#else
*(word *)outBlock = r;
*(word *)(outBlock+4) = l;
#endif
}
void DES_EDE_Encryption::ProcessBlock(byte *inoutBlock) const
{
e.ProcessBlock(inoutBlock);
d.ProcessBlock(inoutBlock);
e.ProcessBlock(inoutBlock);
}
void DES_EDE_Encryption::ProcessBlock(const byte *inBlock, byte *outBlock) const
{
e.ProcessBlock(inBlock, outBlock);
d.ProcessBlock(outBlock);
e.ProcessBlock(outBlock);
}
void DES_EDE_Decryption::ProcessBlock(byte *inoutBlock) const
{
d.ProcessBlock(inoutBlock);
e.ProcessBlock(inoutBlock);
d.ProcessBlock(inoutBlock);
}
void DES_EDE_Decryption::ProcessBlock(const byte *inBlock, byte *outBlock) const
{
d.ProcessBlock(inBlock, outBlock);
e.ProcessBlock(outBlock);
d.ProcessBlock(outBlock);
}
void TripleDES_Encryption::ProcessBlock(byte *inoutBlock) const
{
e1.ProcessBlock(inoutBlock);
d.ProcessBlock(inoutBlock);
e2.ProcessBlock(inoutBlock);
}
void TripleDES_Encryption::ProcessBlock(const byte *inBlock, byte *outBlock) const
{
e1.ProcessBlock(inBlock, outBlock);
d.ProcessBlock(outBlock);
e2.ProcessBlock(outBlock);
}
void TripleDES_Decryption::ProcessBlock(byte *inoutBlock) const
{
d1.ProcessBlock(inoutBlock);
e.ProcessBlock(inoutBlock);
d2.ProcessBlock(inoutBlock);
}
void TripleDES_Decryption::ProcessBlock(const byte *inBlock, byte *outBlock) const
{
d1.ProcessBlock(inBlock, outBlock);
e.ProcessBlock(outBlock);
d2.ProcessBlock(outBlock);
}
NAMESPACE_END
请使用C#编写一个函数,要求返回小于给定整数的所有正奇数之和。
CuteEditor 6.0 在线HTML编辑器的领航者
/dispbbs.asp?boardID=&ID=
ComponentArt.Charting.WebChart.dll
/dispbbs.asp?boardID=&ID=
ComponentArt.Web.UI .2源代码+实例+DLL
/dispbbs___1.html
ComponentArt.WebUI..1破解DLL
/dispbbs.asp?boardID=&ID=
ComponentArt.WebUI..1源代码
/dispbbs.asp?boardID=&ID=
ComponentArt.Web.UI..2
/dispbbs.asp?boardID=&ID=
ComponentArt.Web.UI..2源代码
/dispbbs.asp?boardID=&ID=
ComponentArt.Web.UI..1
/dispbbs.asp?boardID=&ID=
Infragistics NetAdvantage for ASP.NET Vol 2
/dispbbs.asp?boardID=&ID=
Infragistics NetAdvantage AppStylist Vol 2
/dispbbs.asp?boardID=&ID=
Infragistics TestAdvantage WinForms For CLR2
/dispbbs.asp?boardID=&ID=
Infragistics TestAdvantage WinForms for CLR1.x
/dispbbs.asp?boardID=&ID=
Infragistics NetAdvantage for Windows Forms Vol 2
/dispbbs.asp?boardID=&ID=
Infragistics NetAdvantage for WPF
/dispbbs.asp?boardID=&ID=
Infragistics NetAdvantage Vol2 CLR1.x
/dispbbs.asp?boardID=&ID=
Infragistics NetAdvantage Vol2 for CLR2
/dispbbs.asp?boardID=&ID=
Infragistics NetAdvantage Vol2 CLR1.x
/dispbbs.asp?boardID=&ID=
ComponentOne Studio v1.5 for ASP.NET 2.0
/dispbbs.asp?boardID=&ID=
ComponentOne Studio v1.5 for ASP.NET 1.x
/dispbbs.asp?boardID=&ID=
ComponentOne Studio v2 for ASP.NET 2.0
/dispbbs.asp?boardID=&ID=
ComponentOne Studio v2 for ASP.NET 1.x
/dispbbs.asp?boardID=&ID=
ComponentOne Studio for Mobile Devices v1.5 CLR1x
/dispbbs.asp?boardID=&ID=
ComponentOne Studio for Mobile Devices v2 CLR2
/dispbbs.asp?boardID=&ID=
ComponentOne Studio for Mobile Devices v2 CLR1.x
/dispbbs.asp?boardID=&ID=
ComponentOne Studio v1.5 for .NET CLR2
/dispbbs.asp?boardID=&ID=
ComponentOne Studio v1.5 for .NET CLR1.x
/dispbbs.asp?boardID=&ID=
ComponentOne Studio for .NET v2 CLR2
/dispbbs.asp?boardID=&ID=
ComponentOne Studio for .NET v2 CLR1.x
/dispbbs.asp?boardID=&ID=
ComponentOne Studio for ActiveX v1.5
/dispbbs.asp?boardID=&ID=
ComponentOne Studio for ActiveX v2 CLR2
/dispbbs.asp?boardID=&ID=
ComponentOne Studio for ActiveX v2 CLR1.x
/dispbbs.asp?boardID=&ID=
Telerik RadWindow for ASP.NET 2.0 v1.8.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadUpload for ASP.NET 2.0 v2.3.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadTreeView for ASP.NET 2.0 v6.2.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadTabStrip for ASP.NET 2.0 v3.5.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadToolbar for ASP.NET 2.0 v1.5.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadSplitter for ASP.NET 2.0 v1.2.2.1
/dispbbs.asp?boardID=&ID=
Telerik RadSpell for ASP.NET 2.0 v3.1.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadRotator for ASP.NET 2.0 v2.6.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadPanelbar for ASP.NET 2.0 v4.2.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadMenu for ASP.NET 2.0 v4.2.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadInput for ASP.NET 2.0 v2.0.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadGrid for ASP.NET 2.0 v4.6.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadEditor for ASP.NET 2.0 v7.1.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadComboBox for ASP.NET 2.0 v2.7.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadDock for ASP.NET 2.0 v1.8.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadChart for ASP.NET 2.0 v3.2.1.0
/dispbbs.asp?boardID=&ID=
Telerik RadCalendar for ASP.NET 2.0 v2.1.2.0
/dispbbs.asp?boardID=&ID=
Telerik RadAjax for ASP.NET 2.0 v1.7.2.0
/dispbbs.asp?boardID=&ID=
telerik r.a.d.upload
/dispbbs.asp?boardID=&ID=
telerik r.a.d.window
/dispbbs.asp?boardID=&ID=
telerik r.a.d ToolBar
/dispbbs.asp?boardID=&ID=
telerik r.a.d.Chart
/dispbbs.asp?boardID=&ID=
telerik r.a.d.combobox
/dispbbs.asp?boardID=&ID=
DotNetBar for VS 6.8.0.1
/dispbbs.asp?boardID=&ID=
DotnetCharting 4.3破解DLL
/dispbbs.asp?boardID=&ID=
DotNET Charting WebForms
/dispbbs.asp?boardID=&ID=
dotnetCharting.WinForms
/dispbbs.asp?boardID=&ID=
TeeChart for .NET 3.2.. 完美DLL
/dispbbs.asp?boardID=&ID=
TeeChart for .NET 3.2.. 完美DLL
/dispbbs.asp?boardID=&ID=
DevExpress 7.3.4 完美破解DLL
/dispbbs.asp?boardID=&ID=
Dxperience 7.3.5 完美破解DLL
/dispbbs.asp?boardID=&ID=
DevExpress.LocalizationCHS.Dll
/dispbbs___1.html
NickLee.Web.UI
/dispbbs.asp?boardID=&ID=
SolpartWebControls
/dispbbs.asp?boardID=&ID=
AspNetPager 6.0 for ASP.NET 1.x 自定义分页控件
/dispbbs___1.html
AspNetPager 6.0 for ASP.NET 2.0 自定义分页控件
/dispbbs___1.html
数据操作类 Socut.Data.dll for .NET 2.0 v3.1
/dispbbs___1.html
数据操作类 Socut.Data.dll for .NET 1.x v3.1
/dispbbs___1.html
Developer Express for .NET v7.3.5.0全套完美无限制版
/dispbbs.asp?boardID=&ID=
HTML5代码里能怎么才能写jsp代码
HTML5代码可以和jsp混合在一起。
JSP实质上只是为HTML页面封装了对HTTP协议的Request对象和Rsponse对象而已。
就比如说,获取上一个页面的数据、操作Session等。
这也就是各种logo源码,为什么会说“JSP是在HTML里面写Java代码,而Servlet是在JAVA里面写HTML代码”
其实不过是封装了HTTP协议的请求响应而已。
而HTML5,c 源码 销售只是HTML语言的新一代标准。
编写函数int old(int n)判断n是否为奇数,若是map stl源码,则返回1,否则返回0
那就是判断n是否能被2整除,如果能整除,就是偶数,不能整除,就是奇数。程序如下:
#include <iostream>using namespace std;
int odd(int n)
{
return n%2;
}
int main()
{
int n1 = 5;
cout<<odd(n1)<<endl;
int n2 = 4;
cout<<odd(n2)<<endl;
return 0;
}
结果如下
求频率细化分析zoomfft的C++源代码
//下面的FFT我用了很多年了:
// 离散傅里叶变换DFT代码:
int DFT (long count, CComplex * input, CComplex * output)
{
assert(count);
assert(input);
assert(output);
CComplex F, X, T, W; int n, i;
long N = abs(count); long Inversing = count < 0? 1: -1;
for(n = 0; n < N ; n++){ // compute from line 0 to N-1
F = CComplex(0.0f, 0.0f); // clear a line
for(i = 0; i < N; i++) {
T = input[i];
W = HarmonicPI2(Inversing * n * i, N);
X = T * W;
F += X; // fininshing a line
}//next i
// save data to outpus
memcpy(output + n, &F, sizeof(F));
}//next n
return 0;
}//end DFT
//快速傅里叶变换代码FFT
int fft (long count, CComplex * input, CComplex * output)
{
assert(count);
assert(input);
assert(output);
int N = abs(count); long Inversing = count < 0? -1: 1;
if (N % 2 || N < 5) return DFT(count, input, output);
long N2 = N / 2;
CComplex * iEven = new CComplex[N2]; memset(iEven, 0, sizeof(CComplex) * N2);
CComplex * oEven = new CComplex[N2]; memset(oEven, 0, sizeof(CComplex) * N2);
CComplex * iOdd = new CComplex[N2]; memset(iOdd , 0, sizeof(CComplex) * N2);
CComplex * oOdd = new CComplex[N2]; memset(oOdd , 0, sizeof(CComplex) * N2);
int i = 0; CComplex W;
for(i = 0; i < N2; i++) {
iEven[i] = input[i * 2];
iOdd [i] = input[i * 2 + 1];
}//next i
fft(N2 * Inversing, iEven, oEven);
fft(N2 * Inversing, iOdd, oOdd );
for(i = 0; i < N2; i++) {
W = HarmonicPI2(Inversing * (- i), N);
output[i] = oEven[i] + W * oOdd[i];
output[i + N2] = oEven[i] - W * oOdd[i];
}//next i
return 0;
}//end FFT