隨筆-295  評(píng)論-26  文章-1  trackbacks-0

          #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ó)富論
          posted on 2009-03-17 17:47 華夢(mèng)行 閱讀(454) 評(píng)論(0)  編輯  收藏 所屬分類: C
          主站蜘蛛池模板: 方正县| 唐河县| 营山县| 偏关县| 六安市| 赞皇县| 山东省| 朔州市| 东台市| 祁门县| 龙里县| 临汾市| 合肥市| 武汉市| 汶川县| 仪征市| 龙泉市| 巴林右旗| 宣汉县| 新乡县| 江阴市| 安泽县| 北川| 正安县| 莱阳市| 容城县| 武义县| 黔西| 桂东县| 广平县| 阿瓦提县| 监利县| 柞水县| 无锡市| 东阿县| 苗栗县| 普陀区| 株洲县| 平武县| 汶川县| 清涧县|