此类题目要明确两点:
1. 打表:用数组下标索引字符,同时注意如果从字符对应回数字:
int index = (str[i] >= '0' && str[i]
2. 注意低位在前还是高位在前,如果先来的是 低位*radix^i 即可。
3. 统计每几个radix进制数组成一位,利用bits来表示。。。
这破题主要是麻烦。。。
#include
#includ...
分类:
其他好文 时间:
2014-08-12 00:40:33
阅读次数:
184
匈牙利命名法是一种编程时的命名规范。基本原则是:变量名=属性+类型+对象描述,其中每一对象的名称都要求有明确含义,可以取对象名字全称或名字的一部分。这种标记法非常简单,即变量名以一个或者多个小写字母开始,这些字母表示变量的数据型态。例如:szCmdLine 中的 sz 代表“以0结尾的字符串(Str...
分类:
其他好文 时间:
2014-08-12 00:30:03
阅读次数:
262
C语言提供了几个标准库函数,能够将随意类型(整型、长整型、浮点型等)的数字转换为字符串。下面是用itoa()函数将整数转 换为字符串的一个样例: # include # include void main (void) { int num = 100; char str[25]; itoa(nu.....
分类:
编程语言 时间:
2014-08-12 00:12:23
阅读次数:
259
用处:实现一个web浏览器,加载静态html,动态url,调用js//加载动态urlself.webView = [[UIWebView alloc]initWithFrame:self.view.bounds];NSString *str = @"http://www.baidu.com";NSU...
分类:
Web程序 时间:
2014-08-11 17:16:32
阅读次数:
237
关键代码: /// /// 移除字符串末尾指定字符 /// /// 需要移除的字符串 /// 指定字符 /// 移除后的字符串 public static string RemoveLastChar(this string str, string value) {
...
分类:
其他好文 时间:
2014-08-11 17:02:22
阅读次数:
131
php 自带的字符串翻转函数 strrev() 只支持英文,不支持中文,在网上找到了一个方法,支持中英文: <?php
function?reverse($str,?$encode?=?‘UTF-8‘)?{
????$n?=?mb_strlen($str,?$encode);
????...
分类:
Web程序 时间:
2014-08-11 15:27:12
阅读次数:
231
Delphi MD5加密 1、 引用两个单元 uses IdHash,IdHashMessageDigest; 2、编写加密函数 function TEncryption.StrtoMd5(str: string): string; var md5...
分类:
其他好文 时间:
2014-08-11 14:25:12
阅读次数:
179
JAVA 长整型转换为IP地址的方法代码如下: /**
* 整型解析为IP地址
* @param num
* @return
*/
public static String int2iP(Long num)
{
String str = null;
Long[] tt = new Long[4];
tt[0] = (num >>> 24) >>>...
分类:
编程语言 时间:
2014-08-11 12:09:22
阅读次数:
206
UIAlertView使用
基本用法
// 创建一个UIAlertView并显示出来
UIAlertView *alertview = [[UIAlertView alloc] initWithTitle:aTitle message:msg delegate:nil cancelButtonTitle:str otherButtonTitles:nil];
[alertview show];...
分类:
其他好文 时间:
2014-08-11 10:07:51
阅读次数:
202
string str="123abc456";int i=3;1 取字符串的前i个字符 str=str.Substring(0,i); // or str=str.Remove(i,str.Length-i);2 去掉字符串的前i个字符: str=str.Remove(0,i); // or str...
分类:
其他好文 时间:
2014-08-11 10:02:11
阅读次数:
187