// // main.c // Hex conversion // // Created by ma c on 15/7/22. // Copyright (c) 2015年 bjsxt. All rights reserved. // 要求:十进制向任意进制之间的转换(查表法). #include <stdio.h> //十六进制的转换 void ToHex(int num) { int temp; char chs[8];//定义一个临时容器,长度为8,8X4=32位比特 int
够无聊的写这个,为防止需要的人也无聊一遍,写个吧 算法有n种,但是,咱们一种就够用了 --数组倒序排列 local function orderByDesc( input ) local output = {} local count = #input do table.insert(output, input[count] ) count = count - end return output end --进制转换,英文不行只好用拼音 --@dec 10进制数据,好吧,只要是数字就呆以了 --
//字符串转成16进制代码function strToHexStr(str:string):string;varc:char;ss:string;i:integer;beginwhile str<>'' do begin c:=str[1]; ss:=ss+format('%0x',[ord(c)]); delete(str,1,1);end;strtohexStr:= ss;end; //16进制字符串转换成字符串function HexStrToStr(const S
A+B Coming Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9461 Accepted Submission(s): 6173 Problem Description Many classmates said to me that A+B is must needs.If you can’t AC this problem