2017年10月08日普及组 蜡烛
生活随笔
收集整理的這篇文章主要介紹了
2017年10月08日普及组 蜡烛
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
程序:
var n,i,j,t,k,sum:longint; a:array[0..10000] of longint; beginassign(input,'lazhu.in');reset(input);assign(output,'lazhu.out');rewrite(output);readln(n);for i:=1 to n doread(a[i]);for k:=1 to 100 dobeginfor i:=1 to n-1 dofor j:=i+1 to n doif a[i]<a[j] thenbegint:=a[i];a[i]:=a[j];a[j]:=t;end;sum:=0;for i:=1 to n doif a[i]<>0 then inc(sum);if sum<k then break;for i:=1 to k dodec(a[i]);end;writeln(k-1);close(input);close(output); end.轉(zhuǎn)載于:https://www.cnblogs.com/YYC-0304/p/9500036.html
總結(jié)
以上是生活随笔為你收集整理的2017年10月08日普及组 蜡烛的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2017年10月08日普及组 世界语
- 下一篇: 2017年10月08日 上学