soso9spikear
soso9spikear
(+_+)
关注数: 0
粉丝数: 6
发帖数: 1,012
关注贴吧数: 2
clock program clock;type AA:array[1..9,1..11] of integer;const s:array[1..9] of string=(('ABDE'),('ABC'),('BCED'),('ADG'),('BDEFH'),('CFI'),('DEGH'),('GHI'),('EFHI'));var a:AA; q:char; i,j:longint; procedure change(w:AA); var begin end;begin for q:=3 to 11 do read(c[1,i]); i:=1;j:=2; while m do begin for k:=3 to 11 do begin for l:=3 to 11 do a[j,l]:=a[i,l]; a[j,1];=i;a[j,2]:=k change(a[j],k); inc(j); end; end;end.未完成,保留程序
教员都去哪了!!?? 怎么都不见了!!??
教偶显血~ 谁会??~
8queen program queen;var a:array[1..8] of integer; b:array[-7..16,-7..16] of integer; k:integer; procedure main(n:integer); var i,j:integer; begin if n=9 then begin for i:=1 to 8 do write(a[i],' '); writeln; inc(k); end else for i:=1 to 8 do if b[n,i]=0 then begin a[n]:=i; for j:=n+1 to 8 do begin b[j,i]:=b[j,i]+1; b[j,i+j-n]:=b[j,i+j-n]+1; b[j,i-j+n]:=b[j,i-j+n]+1; end; main(n+1); for j:=n+1 to 8 do begin b[j,i]:=b[j,i]-1; b[j,i+j-n]:=b[j,i+j-n]-1; b[j,i-j+n]:=b[j,i-j+n]-1; end; a[n]:=0; end; end;begin main(1); writeln(k);end.
Math库实用汇总 Math库实用汇总 在FP中,Math库为我们提供了丰富的数学函数。以下介绍在OI中可能会用到的Math库中一些函数、过程。 使用方法:在程序头用Uses语句加载Math库 例子: Program Ex_Math; Uses Math; Begin Writeln(hypot(3,4)); End. 函数介绍: hypot 原型:function hypot(x:float;y:float):float 功能:返回直角三角形中较长边的长度,也就是sqrt(sqr(x)+sqr(y)) ceil 原型:function ceil(x:float):Integer 功能:返回比参数大的最小整数 引发错误:在x超出Integer的范围时会引发溢出错误 floor 原型:function floor(x:float):Integer 功能:返回参数小的最大整数 引发错误:在x超出Integer的范围时会引发溢出错误 power 原型:function power(base:float;exponent:float):float 功能:返回base的exponent次方 引发错误:在base为负数且exponent为小数时 intpower 原型:function intpower(base:float;const exponent:Integer):float 功能:返回base的exponent次方 ldexp 原型:function ldexp(x:float;const p:Integer):float 功能:返回2的p次方乘以x log10 原型:function log10(x:float):float 功能:返回x的常用对数 log2 原型:function log2(x:float):float 功能:返回x以2为底的对数 logn 原型:function logn(n:float;x:float):float 功能:返回x以n为底的对数 Max 原型:function Max(a:Integer;b:Integer):Integer function Max(a:Int64;b:Int64):Int64 function Max(a:Extended;b:Extended):Extended 功能:返回a与b中较大的一个 Min 原型:function Min(a:Integer;b:Integer):Integer function Min(a:Int64;b:Int64):Int64 function Min(a:Extended;b:Extended):Extended 功能:返回a与b中较小的一个 arcsin 原型:function arcsin(x:float):float 功能:返回x的反正弦值,返回的是弧度指单位 arccos 原型:function arccos(x:float):float 功能:返回x的反余弦值,返回的是弧度指单位 tan 原型:function tan(x:float):float 功能:返回x的正切值,x以弧度为单位 cotan 原型:function cotan(x:float):float 功能:返回x的余切值,x以弧度为单位 arcsinh 原型:function arcsinh(x:float):float 功能:返回双曲线的反正弦 arccosh 原型:function arccosh(x:float):float 功能:返回双曲线的反余弦 arctanh 原型:function arctanh(x:float):float 功能:返回双曲线的反正切 sinh 原型:function sinh(x:float):float 功能:返回双曲线的正弦 cosh 原型:function sinh(x:float):float 功能:返回双曲线的正弦 tanh 原型:function sinh(x:float):float 功能:返回双曲线的正切 cycletorad 原型:function cycletorad(cycle:float):float 功能:返回圆的份数转换成弧度之后的值 degtorad 原型:function degtorad(deg:float):float 功能:返回角度转换成弧度之后的值 radtocycle 原型:function radtocycle(rad:float):float 功能:返回弧度转换成圆的份数之后的值 radtodeg 原型:function radtodeg(rad:float):float 功能:返回弧度转换成角度之后的值 MaxValue 原型:function maxvalue(const data:Array[] of float):float function maxvalue(const data:Array[] of Integer):Integer function maxvalue(const data:PFloat;const N:Integer):float
坚持一个祈祷 祈祷好神圣,我坚持每天吃饭前的祈祷,感谢一切恩惠.
对不起啊大家....
表明一下.......... 这里的题目中:tju1...是同济大学V1...是vijostjg1...是天京大学
初二2班 这个班里面谁是班草谁是班花
我觉得应该选个吧主啊.......... 怎么米有吧主啊..........??谁当好???(大家不要自己推荐自己....)
一个小游戏~~ http://www1.color8th.com/Content/MyOnly.aspx?Id=217999
推荐一个挺多好文章的论坛~ 并非广告啊.......再说没有吧主........(晕)那里文章确实很不错的,大家不妨去看看
林昊殷就是... 就是二中的那个吗???认识一下~~~我就是曹天齐
呵呵,好久以前看的这个
开家族~~~~~~~~找人 1区,火野猪,想入的人先留言~~~
大家觉得 武林外传里面谁最强?? 我的意见=大家说完了再说~~~别生气~~~
支持慕蓉紫的进来~~ 她的采访好有创意哦~~~~~
谁看过财神写的续集?? 有的,看过的进来~~
关于佟~~~ 大家觉得 冰魄静心咒 如何??~~
在这里尽管聊,聊个够!! 如题,主要是为了解决DRS版聊问题
暑假作业 如下
谢谢支持本帖吧的朋友 吧主真的很感谢那些支持这个帖吧的朋友,今后有什么题做完了,我一定会发上来的!!
tju1016 program p1016;const max=10; bo=2;var apple:array[1..max] of integer; q,t,i,b:longint; str:string; win,j,boy:longint; procedure init(cat:longint); begin {readln(str);} {for ii:=length(str) downto 1 do apple[ii+bo]:=ord(str[ii])-ord('0');} //readln(boy); str:=''; for j:=1 to max do str:=str+'1'; boy:=cat; end; procedure time; begin for j:=1 to max do apple[j]:=apple[j]*boy; end; procedure jinwei; begin for j:=2 to max do begin win:=apple[j]; apple[j]:=win mod 10; apple[j-1]:=apple[j-1]+(win div 10); end; end; {procedure print; begin win:=1;while apple[win]=0 do inc(win); while win<=max do begin write(apple[win]);inc(win);end; writeln; end;} procedure main; begin init(i); time; jinwei; //print; end;begin readln(q); for t:=1 to q do begin fillchar(apple,sizeof(apple),0); apple[max]:=1; readln(b); for i:=2 to b do main; i:=1;while apple[i]=0 do inc(i); writeln(apple[i+1]); end;end.
tju1017 program p1017;const maxn=100;var a:array[1..maxn] of longint; b:array[1..maxn] of boolean; ans,i,n:longint; j:boolean; procedure main(w,x,y:longint); var q:boolean; t:integer; begin if w=n then begin for t:=1 to n do if b[t] then inc(x,a[t]) else inc(y,a[t]); if ans>abs(x-y) then ans:=abs(x-y); end else begin inc(w); for q:=false to true do begin b[w]:=q; main(w,0,0); end; end; end;begin repeat readln(n);ans:=32767; for i:=1 to n do readln(a[i]); for j:=false to true do begin b[1]:=j; main(1,0,0); end; writeln(ans); until seekeof;end.
上次的第二题 program p1059;var n,ans:longint; procedure main(w:longint); var i:longint; begin inc(ans); if w>1 then for i:=1 to w div 2 do main(i); end;begin repeat readln(n); ans:=0; main(n); writeln(ans); until seekeof;end.
tju1072 var s:string;begin s:='var s:string;begin s:='';writeln(copy(s,1,23),copy(s,1,23),copy(s,23,91),copy(s,23,2));writeln(copy(s,25,91));end.';writeln(copy(s,1,23),copy(s,1,23),copy(s,23,91),copy(s,23,2));writeln(copy(s,25,91));end.
tju1044 program p1044;var n,i,t:longint; ok:boolean; function check(w:longint):boolean; var s:string; j:integer; ko:boolean; begin str(w,s);ko:=false;j:=1; while (j<=length(s)) and not ok do begin if s[j]='7' then ok:=true; inc(j); end; check:=ko; end;begin //assign(output,'D:/tongji/answer.pas');rewrite(output); readln(n); t:=0;i:=1; while t
有空看看 XXXXXXXXXXXX XXXXXXXXXXXXX X X X X X X X X X X X X X X X X X X X X X X X X X XXX XXXXXX
tju1028 program p1028;const maxn=100;var a:array['a'..'z'] of boolean; s:array[1..maxn] of string; t,q,i,w,n:longint; j:char;begin readln(t); for q:=1 to t do begin fillchar(a,sizeof(a),false); a['a']:=true; readln(n); for i:=1 to n do readln(s[i]); for w:=1 to n-1 do for i:=1 to n do if a[s[i][1]] or a[s[i][3]] then begin a[s[i][1]]:=true; a[s[i][3]]:=true; end; for j:='a' to 'z' do if a[j] then write(j,' '); end;end.
各个程序大家有什么建议到程序说出来,欢迎 .
tju1000 看的是傻瓜来的,这么简单,还有答案的!!
tju1001 program p1001;var n,i,j,w:longint; procedure print; begin write(chr(w)); dec(w); end;begin readln(n);w:=ord('z'); for i:=1 to n-1 do write(' '); print; writeln; for i:=2 to n do begin for j:=1 to n-i do write(' '); print; for j:=1 to 3*(i-1)+i-2 do write(' '); print; writeln; end; for i:=n-1 downto 2 do begin for j:=1 to n-i do write(' '); print; for j:=1 to 3*(i-1)+i-2 do write(' '); print; writeln; end; for i:=1 to n-1 do write(' '); print; writeln;end.
tju1003 program p1003;var n,i,j:integer;begin readln(n); for i:=1 to n do begin for j:=1 to n-i do write(' '); for j:=1 to 2*i-1 do write(chr(ord('A')-1+i)); writeln; end;end.
tju1004 program p1004;const m=20;var a,b:array[1..m] of integer; c:array[1..m] of boolean; d,i,j,n,w,max:integer; function ok:boolean; var tt:boolean; begin tt:=true; for i:=1 to w do if c[i] then tt:=false; ok:=tt; end;begin assign(input,'D:/tongji/input.txt');reset(input); i:=0; repeat inc(i); read(a[i]); until seekeof; w:=i; for i:=1 to w do b[i]:=1; for i:=w downto 1 do begin max:=0; for j:=i to w do if (a[j]<=a[i]) and (b[j]>max) then max:=b[j]; b[i]:=b[i]+max; end; max:=0; for i:=1 to w do if b[i]>max then max:=b[i]; write(max,' '); for i:=1 to w do c[i]:=true; d:=0; repeat inc(d); for i:=1 to w do if c[i] then begin c[i]:=false; for j:=i to w do if (a[j]<=a[i]) and (a[j]>max) then max:=a[j]; j:=1; while a[j]<>max do inc(j); i:=j; c[j]:=false end; until ok; writeln(d); close(input);end.
tju1005 program p1005;const max=50var s:array[1..max] of longint; n:longint;begin s[1]:=1;s[2]:=1;s[3]:=1; for n:=4 to max do s[n]:=s[n-1]+s[n-3]; repeat readln(n); writeln(s[n]); until seekeof;end.
tju1006 program p1006;var i,n:integer; procedure check(w:integer); var s:string; ok:boolean; i:integer; begin str(w,s);ok:=false; for i:=1 to length(s) do if s[i]='7' then ok:=true; if (w mod 7=0) or ok then writeln(s); end;begin readln(n); for i:=1 to n do check(i);end.
tju1007 program p1007;var i,n:longint;begin repeat readln(n); i:=i+n; until seekeof; writeln(i);end.
tju1008 program p1008;var n,w:longint; procedure yh(m:longint); var i,j:integer; a:array[1..34,1..34] of longint; begin for i:=1 to m do begin for j:=1 to i do if (j=1) or (i=j) then a[i,j]:=1 else a[i,j]:=a[i-1,j]+a[i-1,j-1]; for j:=1 to i do begin if j<>1 then write(' '); write(a[i,j]); end; writeln; end; end;begin w:=1; repeat readln(n); if w<>1 then begin writeln; end; writeln('Case ',w,':'); yh(n); inc(w); until seekeof;end.
tju1009 program p1009;var a:array[1..100,1..100] of integer; w,j,i,n,x,y:integer; procedure print; begin inc(w); a[x,y]:=w; dec(x);inc(y); end;begin repeat readln(n);w:=0; for i:=1 to n do begin x:=i;y:=1; for j:=1 to i do print; end; for i:=1 to n do begin for j:=1 to n-i+1 do begin write(a[i,j]); if j+i<>n+1 then write(' '); end; writeln; end; until seekeof;end.
tju1013 program p1013;var s:string; q:char; n,j:integer; procedure main; var i:integer; begin i:=1; while (ord(s[i])<=ord(s[i+1]))and(i ' ' do begin s:=s+q; read(q); end; readln(n); for j:=1 to n do main; writeln(s); until seekeof;end.
tju1014 program p1014;var c2,c5,n,i:longint; procedure main(w:longint); begin while w mod 2=0 do begin w:=w div 2;inc(c2);end; while w mod 5=0 do begin w:=w div 5;inc(c5);end; end;begin repeat readln(n); c2:=0;c5:=0; for i:=1 to n do main(i); if c2>c5 then writeln(c5) else writeln(c2); until seekeof;end.
tju1015 program p1015;var s:string; w,i:longint;begin repeat readln(s);w:=length(s); for i:=1 to w do begin if s[i]='#' then if i<>1 then begin delete(s,i-1,2); i:=i-2; w:=w-2; end else begin delete(s,1,1); dec(i); end; if s[i]='@' then if i<>1 then begin delete(s,1,i); w:=w-i; i:=1; end else begin delete(s,1,1); dec(i); end; if i>=w then break; end; writeln(s); until seekeof;end.
tju1018 program p1018;var a,b,i:integer; s:string;begin repeat read(a);readln(b); writeln(a:7);writeln('*',b:6); writeln('-------'); if b div 10<>0 then begin writeln(a*(b mod 10):7); writeln(a*(b div 10):6); writeln('-------'); end; writeln(a*b:7); until seekeof;end.
tju1019 program p1019;var i,j,n,a,b,w,u:integer;begin repeat readln(n,a,b); for i:=1 to n do write('(',a,',',i,')'); writeln; for i:=1 to n do write('(',i,',',b,')'); writeln; w:=a;u:=b; if w>u then begin w:=w-u+1;u:=1;end else begin u:=u-w+1;w:=1;end; while (w<=n)and(u<=n) do begin write('(',w,',',u,')'); inc(w);inc(u); end; writeln; w:=a;u:=b; while (w 1) do begin inc(w);dec(u);end; while (w>=1)and(u<=n) do begin write('(',w,',',u,')'); dec(w);inc(u); end; writeln; until seekeof;end.
tju1020 program p1020;const e='error';var i,j,n,po:longint; s,k:string; ok:boolean;begin readln(n); for j:=1 to n do begin readln(s); readln(k); po:=0;ok:=false; if k[1]='D' then begin po:=pos(k[3],s); if po<>0 then begin delete(s,po,1); writeln(s); end else writeln(e); end; if k[1]='I' then begin for i:=length(s) downto 1 do if s[i]=k[3] then begin po:=i; break; end; if po<>0 then begin insert(k[5],s,po); writeln(s); end else writeln(e); end; if k[1]='R' then begin for i:=1 to length(s) do if s[i]=k[3] then s[i]:=k[5]; writeln(s) end; end;end.
tju1027 program p1027;const maxn=10000;var a:array[1..2*maxn] of integer; t,i,n:integer; procedure wash; var s:array[1..2*maxn] of integer; j:integer; begin for j:=1 to n do begin s[2*j-1]:=a[n+j]; s[2*j]:=a[j]; end; for j:=1 to 2*n do a[j]:=s[j]; end; function check:boolean; var j:integer; ok:boolean; begin ok:=true; for j:=1 to 2*n do if a[j]<>j then begin ok:=false; break; end; check:=ok; end;begin repeat readln(n); for i:=1 to 2*n do a[i]:=i; t:=0; repeat wash; inc(t); until check; writeln(t); until seekeof;end.
1
下一页