找出本身想要的漢字的代碼:ios
#include<iostream> #include <string> using namespace std; void main( void ) { char st_str[12][4]={"我","喜","歡","你","作","我","女","朋","友","好","不","好"}; char st_need[4]; char st_word[3]; st_word[2]='\0'; for(int i=0;i<12i++) { strcpy(st_need,st_str[i]); for(int i=0;i<3755;++i) { st_word[0]='\xb0'+(i/94); st_word[1]='\xa1'+(i%94); if(strcmp(st_need,st_word)==0) { cout<<i<<" "<<st_word <<"\t\t"; } else continue; } } cout<<endl; }
全部的漢字代碼輸出(來源於網絡)網絡
#include <iostream> void main() { char word[3]; word[2]='\0'; for(int i=0;i<3755;++i) { word[0]='\xb0'+(i/94); word[1]='\xa1'+(i%94); cout <<word <<" "; } cout <<endl; }