一、实例变量的可见度(访问权限)二、方法OC中的?方法分两种:类?方法和实例?方法。类?方法:只能类使?用,例如:+(id)alloc 注:类?方法中不能使?用 实例变量实例?方法:只能对象使?用,例如: -(void)sayHi 三、直接贴代码//
// main.m
// OC_Practice_02
//
// Created by on 15/3/31.
// Copyright...
分类:
其他好文 时间:
2015-06-18 17:28:07
阅读次数:
101
Two month fan of the book, from August - Oct. 2014; and then, started to practice code review, change the code to make it readable. Big fan of DRY (Do...
分类:
其他好文 时间:
2015-06-18 09:20:41
阅读次数:
127
C - Data Structure?
Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
Submit Status Practice HDU
4217
Description
Data structure is one of the basic skills...
分类:
其他好文 时间:
2015-06-12 11:51:24
阅读次数:
85
L - Minimum Sum LCM
Time
Limit:3000MS Memory Limit:0KB 64bit
IO Format:%lld & %llu
Submit Status Practice UVA
10791
题意:输入正整数n,找至少两个数,使得他们的LCM为n且要输出最小的和;
思路:既然LCM是n,那么一定是...
分类:
其他好文 时间:
2015-06-11 23:04:29
阅读次数:
123
I - Teams
Time Limit:1000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Submit Status Practice UVA
11609
题意:有n个人,选多个人参加比赛,其中一个是队长,队长不同其他选手相同也算作不同的方案,。问你一共有多少种方案。
思路:自己才纸上稍微推理一下,n...
分类:
其他好文 时间:
2015-06-11 23:02:56
阅读次数:
139
F - Greedy?
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d
& %I64u
Submit Status Practice HDU
4221
Description
iSea is going to be CRAZY! Recently, he was assig...
分类:
其他好文 时间:
2015-06-11 14:41:10
阅读次数:
137
题目大意:有一个人在投篮,投不进的概率为p。现在他要玩一个游戏,如果连续投中m颗球或者连续投不进n颗球,那么就停止投篮
现在问,他停止投篮的期望是多少解题思路:设g[i]为已经投中了i颗,还需要投进m-i颗球的期望,设f[i]为投丢了i颗,还需要再投丢n-i颗球的期望,那么可得公式
g[i] = (1-p) * (g[i+1] + 1) + p * (f[1] + 1),即
g[i] = (1...
分类:
其他好文 时间:
2015-06-11 00:13:30
阅读次数:
142
K - Integer Game
Time Limit:1000MS Memory Limit:0KB 64bit IO Format:%lld
& %llu
Submit Status Practice UVA
11489
题意:在n中取数字,使剩下的数是3的倍数,不能取则失败。
思路:如果能使当前数为3的倍数,数字和必是3的倍数。...
分类:
其他好文 时间:
2015-06-10 22:35:38
阅读次数:
139
K - Integer GameTime Limit:1000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVA 11489题意:在n中取数字,使剩下的数是3的倍数,不能取则失败。思路:如果能使当前数为3...
分类:
其他好文 时间:
2015-06-10 22:29:05
阅读次数:
163
J - Palindrome Numbers
Time Limit:3000MS Memory
Limit:0KB 64bit IO Format:%lld & %llu
Submit Status Practice UVALive
2889
WA了一版面,我也是醉了,就因为一个编译环境不同。。。。。。
说多了都是泪。
题...
分类:
其他好文 时间:
2015-06-10 14:11:31
阅读次数:
131