¸ÕѧC£¬ÓÃCʵÏÖ±àÂë - C/C++ / CÓïÑÔ
#include"stdio.h"
#include"stdlib.h"
void ContrTwo(char i)
{
char str1[8];
itoa(i,str1,2);
printf("%s",str1);
}
unsigned char leftRot(char str,int i);
unsigned char DEVC(char str,char g);
unsigned char mAdd(char str,char r);
void main()
{
char Pstr,Scma,R,TerMa;
printf("Ñ»·±àÂë\n");
printf("ÇëÊäÈëÐÅÏ¢Âëm(x)£º");
scanf("%c",&Pstr);
printf("\nÇëÊäÈëÉú³ÉÂë×Ög(x)£º");
scanf("%c",&Scma);
Pstr=leftRot(Pstr,4);
R=DEVC(Pstr,Scma);
TerMa=mAdd(Pstr,R);
ContrTwo(TerMa);
}
unsigned char leftRot(char str,int i)//Ïò×óÒÆËÄλ
{
str=str<<i;
return str;
}
unsigned char DEVC(char str,char g)//µÃµ½¼à¶½Óàʽ
{
int i;
for(i=4;i>=2;i--)
{
g=leftRot(g,i);
str=str^g;
}
return str;
}
unsigned char mAdd(char str,char r)//µÃµ½±àÂë
{
char c;
c=leftRot(str,4);
c=str^r;
return c;
}
--------------------
µ±ÊäÈë101ʱÐÅÏ¢Âð¶ÔÓ¦µÄ5ºÍÊäÈë0111¶ÔÓ¦µÄ7ʱÔõôµÃ²»µ½¶ÔÓ¦µÄ´ð°¸£¿
±àÂë²½Ö裺
£±¡¢n-k=r=7-3=4,ÓÃx4³Ëm(x)µÄÔËËãʵ
¼ÊÉÏÏ൱ÓÚÔÚÐÅÏ¢Âë110ºó¸½ÉÏ4¸ö
0,±äΪ1100000
£²¡¢ÓÃxrm(x)=x4(x2+x)=x6+x5³ýÒÔg(x),
Èçͼ(a)Ëùʾ,µÃµ½¼à¶½Óàʽr(x)=x2+1¡£
&
Ïà¹ØÎÊ´ð£º
×î½üͻȻÏë×Ô¼ºÀ´ÊµÏÖÒ»¸öÎå×ÓÆå³ÌÐò,µ«²»ÖªµÀÔõô¿ªÊ¼,×Ô¼ºÒ²Ã»Ñ§»Í¼Ðκ¯Êý,ÄÜÔÚ¿ØÖÆ̨ÏÂÖ±½ÓдÂð>>>?????
¿ØÖÆ̨£¿±ÈͼÐνçÃæ¸üÂé·³¡£
http://search.download.csdn.net/search/%E4%BA%94%E5%AD%90% ......
ÎÊÌâ:¹¤µØÉÏÐèÒª³¤¶ÈΪA1µÄ¸Ö½îX¸ù,³¤¶ÈΪA2µÄ¸Ö½îY¸ù,³¤¶ÈΪA3µÄ¸Ö½îZ¸ù......ÒÔ´ÎÀàÍÆ.
ÆäÖÐA1,A2,A3,...³¤¶ÈÈÎÒâÖ¸¶¨,X,Y,Z,...ÊýÁ¿Ò²ÈÎÒâÖ¸¶¨.
µ«²Ö¿âÖеĸֽîΪ±ê×¼³¤¶È,Ö»ÓÐ9Ã׺Í15Ã×Á½ÖÖ³¤¶È,ÊýÁ¿² ......
±àÒëÆ÷£ºC-Free4
mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓá£
×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£
Íü¸ßÊÖÖ¸µãÒ»¶ ......
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......