#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;
}
//進制之間的轉換
? // 字符串傳為16進制
void? myToHex(){
?char c[] = "CC";
?unsigned long tt= strtoul(c, NULL, 16);
cout<<strtol(c, NULL, 16);
}
// 字符串傳為16進制
void? myToBinary(){
?char c[] = "10000000";
//?unsigned long tt= strtoul(c, NULL, 2);
?cout<<strtol(c, NULL, 2);
?
?
}
//漢字的轉換, 16進制轉換為漢字
void transToGKB(char *t){
?
?//?char *t="商戶";
?//?CharN
?//如果是負數,則轉為正整數
?//?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="商戶說的算";
??? //轉成數字并且保存到數組,然后求異或
?//求的長度
const int mylen=strlen(tt)+1;
char mysplit[1000];
//循環對這個整形數組進行賦值
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;
}
//進行遍歷求異或
mysplit[mylen-1]='\0';
cout<<mysplit;
cout<<"ee";
if(result<0)
result=256+result;
cout<<result;
?//int j=t[0];
//?cout<<t<<endl;
?}
?
大盤預測 國富論