1、图片的压缩
封装类方法
+ (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)newSize
{
// Create a graphics image context
UIGraphicsBeginImageContext(newSize);
// Tell the ol...
分类:
移动开发 时间:
2015-06-02 15:18:33
阅读次数:
166
泛型方法中可以定义泛型参数,此时,参数的类型就是传入的数据类型。格式: 访问修饰符 泛型标识 方法名称([翻新标识 参数名称]) {}class Generic { public T tell(T t) { return t; }}public class Generi...
分类:
其他好文 时间:
2015-06-01 22:13:39
阅读次数:
114
public class GenericArray { public static void main(String args[]) { String str[] ={"呵","呵呵","呵呵呵"}; tell(str); } public static ...
分类:
编程语言 时间:
2015-06-01 20:26:14
阅读次数:
103
向上转型(Son-->Father),程序会自动完成父类 父类对象 = 子类实例向下转型(Father-->Son),强制类型转换子类 子类对象 = (子类)父类实例class Father { public void tell() { System.out.println("F...
分类:
其他好文 时间:
2015-05-31 23:01:49
阅读次数:
181
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s...
分类:
其他好文 时间:
2015-05-29 13:40:20
阅读次数:
163
题意
A array contain N number, can you tell me how many different pair i,j that satisfy a[i] + a[j] = M and 1
0
思路:
用map记录会超时
所以想到手写二分。思考一下其实满足题目条件的对数和每个数字的位置并没有关系——排序+二分查找(范围来确定个数)即可。
code:
...
分类:
其他好文 时间:
2015-05-16 16:35:53
阅读次数:
98
基本的流操作也不介绍了,简单地回顾一下自己在文件操作中遇到问题时,又新学到的一些东西,哈哈,刚刚开始入门啦~之前对其中几个函数的理解不是很透彻,所以主要介绍一下这几个函数吧!(1)seek()和tell()根据输入流和输出流又分别分为seekp()、seekg()和tellp()、tellg()。原...
分类:
编程语言 时间:
2015-05-15 21:12:12
阅读次数:
125
SOJ3191 ,Free square,容斥原理,二分,数论。
A positive integer is said to be squarefree if it is divisible by no perfect square larger than 1.
For example, the first few squarefree numbers are {1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, ...}.
Can you tell me the...
分类:
其他好文 时间:
2015-05-10 14:25:13
阅读次数:
98
http://acdream.info/problem?pid=1726
Problem Description
Recently, Losanto find an interesting Math game. The rule is simple: Tell you a number H, and you can choose some numbers from a set {a...
分类:
其他好文 时间:
2015-05-10 11:29:52
阅读次数:
192
This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.
Input Specification:
Each input file contains one t...
分类:
其他好文 时间:
2015-04-29 17:12:41
阅读次数:
131