码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
从一个小程序明白new和delete的奇特现象
#include #include using namespace std;class emp{ protected: string name; public: emp(){} virtual ~emp(){} virtual void print() = 0; };class emp...
分类:其他好文   时间:2015-06-04 15:40:56    阅读次数:121
android Canvas drawText 文字居中
1首先利用canvas获取画布的宽高,//获取屏幕的宽和高int width = canvas.getWidth();int height = canvas.getHeight();2获取文字的宽度, private int getTextWidth(Paint paint, String t...
分类:移动开发   时间:2015-06-04 15:37:27    阅读次数:165
计算1的个数
标题: 1的个数从1到20的所有数字中含有多少个“1”,仔细数一下,应该是12个。那么从1到1000的整数中,含有多少个“1”呢?请填写该数字。代码:public class Number1 { public static void main(String[] args) { /...
分类:其他好文   时间:2015-06-04 15:32:04    阅读次数:79
C#泛型编程
泛型:通过参数化类型来实现在同一份代码上操作多种数据类型。利用“参数化类型”将类型抽象化,从而实现灵活的复用。例子代码:class Program { static void Main(string[] args) { int obj = 2; Test test = new Test(obj); ...
分类:Windows程序   时间:2015-06-04 15:12:01    阅读次数:185
MVC 载入不同的MasterPage页面
public class GroupMasterPage : ActionFilterAttribute { private string _masterName; public GroupMasterPage(string masterName) {...
分类:Web程序   时间:2015-06-04 15:11:42    阅读次数:132
C# Process的使用
private static string ExecuteCmd(string wrokDirectory, string dosCommand) { string output = string.Empty; if (string.IsNullOrEmpty(...
分类:Windows程序   时间:2015-06-04 15:08:39    阅读次数:135
MD5工具类
package com.huowolf.Util; import java.security.MessageDigest; import sun.misc.BASE64Encoder; public class MD5Util { public static String encode(String message) { try { MessageDigest md = Mess...
分类:其他好文   时间:2015-06-04 13:49:26    阅读次数:106
hdu 2051 Bitset (java)
问题: 之前做过类似题,但这次仍然不能解决相关问题。 字符串倒过来输:StringBuffer str=new StringBuffer(s); s=str.reverse().toString() Bitset Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)...
分类:编程语言   时间:2015-06-04 13:49:20    阅读次数:207
HDU 2648(搜索题,哈希表)
#include #include #include #include #include using namespace std; #define N 10005 map elem; int node[N]; int main() { int n,m,i,val,j,rank; string str; while(cin>>n){ int n1=n; ...
分类:其他好文   时间:2015-06-04 13:47:40    阅读次数:168
null 与 string.IsNullOrEmpty 区别
!=null就是不为null!string.IsNullOrEmpty不是null且不是""(string.Empty)-----------Response:!=null就是不为null!string.IsNullOrEmpty不是null且不是""(string.Empty)
分类:其他好文   时间:2015-06-04 13:44:57    阅读次数:121
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!