119 条题解

  • 0
    @ 2009-09-08 11:39:52

    var

    s:string;

    x1,x2,h1,h2,k:longint;

    ch1:char;

    p:real;

    procedure pz(s:string;var h,x:longint);

    var

    i,j,k:integer;

    s1:string;

    begin

    h:=0;x:=0;

    s:='+'+s;

    i:=1;

    while i

  • 0
    @ 2009-09-07 20:47:50

    本来不打算做出来的……结果“二次方程”那题居然过了~

    于是改了改~hoho

    #include

    #include

    #include

    using namespace std;

    int main()

    {

    char s1[300],s2[300];

    char lett;

    scanf("%[^=]=%s",s1,s2);

    int coef=1;int tomul=1;bool dirt=false;

    int c[2]={0};

    for (int i=0;i='a' && s1[i]='0' && s1[i]

  • 0
    @ 2009-08-30 18:33:02

    没想到我的程序还会出现输出等于-0.000的情况

    判断一下,终于AC了

  • 0
    @ 2009-08-26 18:24:35

    交了好多次 发现打错了一个变量

    还硬是过了4组

    rp····

    program xiti;

    var st,st1,st2:string;

    k,i,j,n,f,u,v:longint;

    ans:real;

    ch:char;

    begin

    readln(st);

    j:=pos('=',st);

    st1:=copy(st,1,j-1);

    delete(st,1,j);

    st2:=st;

    k:=0;

    n:=0;

    if st1[1]'-' then

    st1:='+'+st1;

    while st1'' do

    begin

    if st1[1]='-' then

    f:=-1

    else

    f:=1;

    delete(st1,1,1);

    j:=pos('-',st1);

    if ((pos('+',st1)

  • 0
    @ 2009-08-19 15:07:35

    我恨字符串!

  • 0
    @ 2009-08-18 19:20:10

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    var a:array[0..1000]of boolean;

    d,c,u,z:array[0..1000]of longint;

    i,j,n,x,y,t,f,zuo1,zuo2,q,w,b,h,you1,you2:longint;

    r:char;

    st:string;

    begin

    fillchar(d,sizeof(d),0);

    fillchar(c,sizeof(c),0);

    readln(st);

    n:=length(st);

    t:=0;

    x:=0;

    for i:=1 to n do a[i]:=true;

    for i:=1 to n do if (st[i]>='a')and(st[i]='a')and(st[i]0)and(st[j]>='0')and(st[j]=1)and(st[j]='-') then c[x]:=-c[x];

    end;

    end;

    for i:=1 to x do zuo1:=zuo1+c[i];

    for i:=1 to y-1 do

    begin

    if (st[i]>='0')and(st[i]1)and(st='-') then q:=-1 else q:=1;

    inc(t);

    a[i]:=false;

    f:=i;

    while (f='0')and(st[f]='a')and(st[i]y)and(st[j]>='0')and(st[j]=y)and(st[j]='-') then u[x]:=-u[x];

    end;

    end;

    for i:=1 to x do you1:=you1+u[i];

    t:=0;

    for i:=y+1 to n do

    begin

    if (st[i]>='0')and(st[i]y)and(st='-') then q:=-1 else q:=1;

    inc(t);

    a[i]:=false;

    f:=i;

    while (f='0')and(st[f]

  • 0
    @ 2009-08-07 12:48:01

    var

    st,t:string; ch:char;

    i,j,k,p,x,c,code:longint;

    procedure xDo(s:string;kk:longint);

    var i:longint;

    begin

    i:=1;

    while (s'.') do

    begin

    inc(i);

    if (s[i]='-') or (s[i]='+') or (s[i]='.') then

    begin

    t:=copy(s,1,i-1);

    delete(s,1,i-1);

    if t in ['0'..'9'] then

    begin

    val(t,k,code);

    c:=c-k*kk;

    end else

    begin

    ch:=t;

    delete(t,i-1,1);

    val(t,k,code);

    x:=x+k*kk;

    end;

    i:=1;

    end;

    end;

    end;

    begin

    readln(st);

    p:=pos('=',st); x:=0; c:=0;

    st[p]:='.';

    st:=st+'.';

    xDo(copy(st,1,p),1);

    xDo(copy(st,p+1,length(st)-p),-1);

    writeln(ch+'=',c/x:0:3);

    end.

  • 0
    @ 2009-08-07 10:14:25

    是不是有点长- -!!

    program p1;

    var

    s1,s2,i,mm,tou,wei,ll:integer;

    s,ls,rs,sx:string;

    x:char;

    xx:real;

    begin

    s1:=0;

    s2:=0;

    readln(s);

    for i:=1 to length(s) do

    if (s[i]'-')or (s[i]'=')or (s[i]'+') then

    if (ord(s[i])>=65)and(ord(s[i])=97)and(ord(s[i])

  • 0
    @ 2009-08-04 00:19:34

    咱是硬汉!!!

    硬题用硬道理做!!!

    样例过了之后一次AC

  • 0
    @ 2009-08-01 18:34:38

    历经多个小时的奋战,

    按了上十次的F7 ,

    终于AC~~~

  • 0
    @ 2009-07-29 17:19:37

    123456

  • 0
    @ 2009-07-28 09:26:43

    我讨厌字符串!

  • 0
    @ 2009-07-27 16:05:31

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    var

    ch:char;

    s:string;

    a,b,c,d,p:integer;

    ans:real;

    procedure slove(s:string;var x,y:integer);

    var q,m,i:integer;

    begin

    x:=0;y:=0;i:=1;

    repeat

    m:=0;q:=1;

    case s[i] of

    '+':begin q:=1;inc(i);end;

    '-':begin q:=-1;inc(i);end;

    end;

    if s[i]=ch then m:=1;

    while (i0 then break;

    slove(copy(s,1,p-1),a,b);

    slove(copy(s,p+1,length(s)-p),c,d);

    ans:=(d-b)/(a-c);

    if abs(ans)

  • 0
    @ 2009-07-25 15:34:55

    ..66/99(67%)..在此留作纪念..~

  • 0
    @ 2009-07-16 09:54:13

    var

    s,s1,s2:ansistring;

    ans:real;

    sign:char;

    procedure work(s:ansistring;var x1,x2:longint);

    var

    i,x:longint;

    fg:boolean;

    begin

    x1:=0;

    x2:=0;

    i:=0;

    while ilength(s))or(s[i] in ['-','+']);

    if s in ['0'..'9'] then if fg then x1:=x1+x

    else x1:=x1-x

    else if fg then x2:=x2+x

    else x2:=x2-x;

    end;

    end;

    procedure init;

    var

    n,x1,x2,y1,y2:longint;

    begin

    readln(s);

    n:=pos('=',s); +

    s1:=copy(s,1,n-1);

    s2:=copy(s,n+1,length(s)-n);

    n:=1;

    while (s[n] in ['0'..'9'])or(s[n] in ['+','-','=']) do inc(n);

    sign:=s[n];

    work(s1,x1,x2);

    work(s2,y1,y2);

    ans:=(y1-x1)/(x2-y2);

    if abs(ans)

  • 0
    @ 2009-07-15 21:38:22

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    把方程从头到尾搜一遍,最后转化成Ax+B=0的式子

  • 0
    @ 2009-07-01 20:47:23

    简单字符串

  • 0
    @ 2009-06-27 21:30:56

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案正确... 0ms

    ---|---|---|---|---|---|---|---|-

    Accepted 有效得分:100 有效耗时:0ms

    一次就A了!

    取出的过程procedure zhuan(s3:string);

    var

    i,j:integer;

    begin

    for i:= 1 to length(s3) do

    begin

    if (s3[i]='-')or(s3[i]='+') then begin inc(k);f[k].fu:=s3[i];continue;end;

    if s3[i] in ['0'..'9'] then

    f[k].xi:=f[k].xi*10+ord(s3[i])-48;

    if s3[i] in ['a'..'z'] then

    f[k].we:=s3[i];

    end。

  • 0
    @ 2009-06-26 20:43:41

    type fc1=record

    sj:string;

    fh:char;

    bl:boolean;

    end;

    var

    fc,s:string;

    x:char;

    f:array[1..100] of fc1;

    m,len,i,j,y,n,a,b:integer;

    begin

    readln(fc);

    a:=0;

    b:=0;

    len:=length(fc);

    m:=pos('=',fc);

    i:=0;

    j:=1;

    if fc[1]'-' then f[1].fh:='+';

    repeat

    inc(i);

    if (ord(fc[i])96) then begin x:=fc[i];f[j].bl:=true; end;

    if fc[i]='-' then begin inc(j);f[j].fh:='-'; end;

    if fc[i]='+' then begin inc(j);f[j].fh:='+'; end;

    if (ord(fc[i])47) then f[j].sj:=f[j].sj+fc[i];

    y:=j;

    until i=m;

    i:=m;

    j:=y+1;

    repeat

    inc(i);

    if (ord(fc[i])96) then begin x:=fc[i];f[j].bl:=true; end;

    if fc[i]='-' then begin inc(j);f[j].fh:='+'; end;

    if fc[i]='+' then begin inc(j);f[j].fh:='-'; end;

    if (ord(fc[i])47) then f[j].sj:=f[j].sj+fc[i];

    y:=j;

    until i=len;

    for i:=1 to y do

    if (f[i].fh'+')and(f[i].fh'-') then f[i].fh:='-';

    for i:=1 to y do

    begin

    s:=f[i].sj;

    val(s,n);

    if f[i].bl then

    case f[i].fh of

    '-',' ':a:=a-n;

    '+':a:=a+n;

    end

    else

    case f[i].fh of

    '-',' ':b:=b-n;

    '+':b:=b+n;

    end;

    end;

    writeln(x,'=',(-b)/a:0:3);

    end.

  • 0
    @ 2009-06-15 20:17:07

    第一次

    编译通过...

    ├ 测试数据 01:答案正确... 0ms

    ├ 测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案错误... ├ 标准行输出 0.00...

     ├ 错误行输出 -0.0...

    ---|---|---|---|---|---|---|---|-

    Unaccepted 有效得分:83 有效耗时:0ms

    第二次

    ├ 测试数据 01:答案正确... 0ms

    ├测试数据 02:答案正确... 0ms

    ├ 测试数据 03:答案正确... 0ms

    ├ 测试数据 04:答案正确... 0ms

    ├ 测试数据 05:答案错误...程序输出比正确答案长

    ---|---|---|---|---|---|---|---|-

    Unaccepted 有效得分:83 有效耗时:0ms

    (忘记了0.000会变成0.0000000000000000e+0.0000)

    第三次终于通过了

信息

ID
1344
难度
5
分类
模拟 点击显示
标签
递交数
2927
已通过
1018
通过率
35%
被复制
18
上传者