#include <iostream.h>
#include <string>
void yihuo(char *t,int n, int m);
void? myToBinary();
void transToGKB(char *t);
void? myToHex();
int main(){
//cout<<"GOOD";
int i=122;
int j=233;
int m=j^i;
?char t[128]={0xC9,0xCC,0xC9,0xCC,0xC9,0xCC,'\0',0xC9,0xCC,0xC9,0xCC};
yihuo(t,0, 2);
//?transToGKB(t);
//cout<<m;
//yihuo(2, 3);
//myToHex();
// myToBinary();
cout<<endl;
return 0;
}
//進(jìn)制之間的轉(zhuǎn)換
? // 字符串傳為16進(jìn)制
void? myToHex(){
?char c[] = "CC";
?unsigned long tt= strtoul(c, NULL, 16);
cout<<strtol(c, NULL, 16);
}
// 字符串傳為16進(jìn)制
void? myToBinary(){
?char c[] = "10000000";
//?unsigned long tt= strtoul(c, NULL, 2);
?cout<<strtol(c, NULL, 2);
?
?
}
//漢字的轉(zhuǎn)換, 16進(jìn)制轉(zhuǎn)換為漢字
void transToGKB(char *t){
?
?//?char *t="商戶";
?//?CharN
?//如果是負(fù)數(shù),則轉(zhuǎn)為正整數(shù)
?//?if(0>t[0]){
?//??? res=256+t[0];
?//?}
?int j=t[0];
?cout<<t<<endl;
}
void yihuo(char *t,int n, int m) {
?char *tt="商戶說的算";
??? //轉(zhuǎn)成數(shù)字并且保存到數(shù)組,然后求異或
?//求的長(zhǎng)度
const int mylen=strlen(tt)+1;
char mysplit[1000];
//循環(huán)對(duì)這個(gè)整形數(shù)組進(jìn)行賦值
int i=0;
for(i<0;i<mylen-1;i++){
?if (tt[i]<0){
mysplit[i]=256+tt[i];
?}else
?{
mysplit[i]=tt[i];
?}
}
int result=mysplit[n-1];
int j;
for(j=n;j<n+m;j++){
?result=result^mysplit[n];
?cout<<"L"<<endl;
cout<<mysplit[n];
?cout<<"M"<<endl;
}
//進(jìn)行遍歷求異或
mysplit[mylen-1]='\0';
cout<<mysplit;
cout<<"ee";
if(result<0)
result=256+result;
cout<<result;
?//int j=t[0];
//?cout<<t<<endl;
?}
?
大盤預(yù)測(cè) 國(guó)富論