摘要: #includeusing namespacestd;intmain(){ intn,x,y; while(cin>>n,n) { cin>>x; while(--n) { cin>>y; x=x^y; } cout<<x<<"\n"; } return0;} 阅读全文
posted @ 2014-07-20 15:46 PastLIFE 阅读(231) 评论(0) 推荐(0)
摘要: SSCANF用法:(继qsort,bsearch,strchr后发现的又一好使的函数)sscanf与scanf类似,都是用于输入的,只是后者以键盘(stdin)为输入源,前者以固定字符串为输入源。例子: 1. 常见用法。char buf[512] ;sscanf("123456 ", "%s", b... 阅读全文
posted @ 2014-07-20 12:48 PastLIFE 阅读(229) 评论(0) 推荐(0)
摘要: Ai=(Ai-1+Ai+1)/2-Ci(i=1,2,3,....n).用A5做示范,就能猜测出公式来。证明方法可以采用数学归纳法。这里证明从略。A5=(A4+A6)/2-C5A4=(A3+A5)/2-C4=A3/2+A4/4+A6/4-C5/2-C4=>A4=2A3/3+A6/3-2C5/3-4C4... 阅读全文
posted @ 2014-07-20 12:18 PastLIFE 阅读(245) 评论(0) 推荐(0)