微软笔试题(看到的写答案啊)
来源:互联网 发布:Ubuntu设置软件源 编辑:程序博客网 时间:2024/06/05 05:52
int func(int n, int* r){
printf("n=%d *r=%d\n",n,*r);//加了个打印的东西 return n && (*r += n) && func(n-1, r);}int main(){ int r = 0; func(100, &r); return 0;}
&&还具有短路的功能,即如果第一个表达式为false,则不再计算第二个表达式,例如,对于if(str != null && !str.equals(“”))表达式,当str为null时,后面的表达式不会执行,所以不会出现NullPointerException如果将&&改为&,则会抛出NullPointerException异常。If(x==33 & ++y>0) y会增长,If(x==33 && ++y>0)不会增长
n=100 *r=0n=99 *r=100n=98 *r=199n=97 *r=297n=96 *r=394n=95 *r=490n=94 *r=585n=93 *r=679n=92 *r=772n=91 *r=864n=90 *r=955n=89 *r=1045n=88 *r=1134n=87 *r=1222n=86 *r=1309n=85 *r=1395n=84 *r=1480n=83 *r=1564n=82 *r=1647n=81 *r=1729n=80 *r=1810n=79 *r=1890n=78 *r=1969n=77 *r=2047n=76 *r=2124n=75 *r=2200n=74 *r=2275n=73 *r=2349n=72 *r=2422n=71 *r=2494n=70 *r=2565n=69 *r=2635n=68 *r=2704n=67 *r=2772n=66 *r=2839n=65 *r=2905n=64 *r=2970n=63 *r=3034n=62 *r=3097n=61 *r=3159n=60 *r=3220n=59 *r=3280n=58 *r=3339n=57 *r=3397n=56 *r=3454n=55 *r=3510n=54 *r=3565n=53 *r=3619n=52 *r=3672n=51 *r=3724n=50 *r=3775n=49 *r=3825n=48 *r=3874n=47 *r=3922n=46 *r=3969n=45 *r=4015n=44 *r=4060n=43 *r=4104n=42 *r=4147n=41 *r=4189n=40 *r=4230n=39 *r=4270n=38 *r=4309n=37 *r=4347n=36 *r=4384n=35 *r=4420n=34 *r=4455n=33 *r=4489n=32 *r=4522n=31 *r=4554n=30 *r=4585n=29 *r=4615n=28 *r=4644n=27 *r=4672n=26 *r=4699n=25 *r=4725n=24 *r=4750n=23 *r=4774n=22 *r=4797n=21 *r=4819n=20 *r=4840n=19 *r=4860n=18 *r=4879n=17 *r=4897n=16 *r=4914n=15 *r=4930n=14 *r=4945n=13 *r=4959n=12 *r=4972n=11 *r=4984n=10 *r=4995n=9 *r=5005n=8 *r=5014n=7 *r=5022n=6 *r=5029n=5 *r=5035n=4 *r=5040n=3 *r=5044n=2 *r=5047n=1 *r=5049n=0 *r=5050Press any key to continue
- 微软笔试题(看到的写答案啊)
- 早上看到的微软笔试题,随便写个答案
- 微软笔试题(附答案)
- 微软曾经笔试题答案
- 微软2007华工笔试算法题及我的答案
- 微软2012实习生笔试题及答案(望讨论)
- 微软2012暑期实习笔试题(附答案)
- 微软2012暑期实习笔试题(附答案)
- 微软2013暑假实习生笔试题(有答案)
- 微软2012暑期实习笔试题(附答案)
- 网上的微软笔试试题和答案
- 看到的一些笔试题(一)。
- MySQL笔试题附加自己写的答案
- 2014 微软校招笔试题以及答案(求指正)
- 【2013.4.6】微软暑期实习生笔试题和答案
- 微软2013年校园实习生招聘笔试题及答案
- 2014 微软校招笔试答案 编程题
- 最近看到的几道笔试题
- 程序员的假期总结——竹子(一)
- 等概率随机函数的实现
- Ant学习笔记
- ADT插件的安装方法
- Hdu 3927 反幻方
- 微软笔试题(看到的写答案啊)
- UiTableView相关文章
- python手记(36)
- 快捷方式的添加与删除
- Unity3D精简版网络游戏雏形(简单网络通信聊天和角色监视案例)
- jQuery UI调用draggable之后无法拖拽的解决办法
- Linux Kernel 之AP读写Nand Flash上的Yaffs2文件的全过程浅析
- POJ 1077 HDU 1043 Eight (IDA*)
- hdu - 1757 - A Simple Math Problem(矩阵快速幂)