159 条题解

  • 0
    @ 2015-09-27 17:04:26

    c语言65行代码哦 你们给几分?

    #include <stdio.h>

    int p1,p2,p3;
    char in[1000];
    int i;

    int judge(){
    if(in[i]=='\0')
    return 1;
    if((in[i]=='-'&&(i==0||in[i-1]>=in[i+1]||in[i-1]=='-'))||in[i]!='-'||(in[i]=='-'&&in[i-1]<60&&in[i+1]>60))
    return 2;
    if(in[i]=='-'&&in[i-1]<in[i+1])
    return 3;
    }

    void function(){
    int j,m;
    if(p3==1){
    for(j=in[i-1]+1;j<in[i+1];j++)
    for(m=0;m<p2;m++){
    if(p1==1)
    printf("%c",j);
    if(p1==2){
    if(j>60)
    printf("%c",j-32);
    else
    printf("%c",j);
    }
    if(p1==3)
    printf("*");

    }

    }

    if(p3==2){
    for(j=in[i+1]-1;j>in[i-1];j--)
    for(m=0;m<p2;m++){
    if(p1==1)
    printf("%c",j);
    if(p1==2){
    if(j>60)
    printf("%c",j-32);
    else
    printf("%c",j);
    }
    if(p1==3)
    printf("*");

    }

    }

    }

    int main(){
    scanf("%d%d%d",&p1,&p2,&p3);
    scanf("%s",&in);
    for(i=0;i<1000;i++){
    if(judge()==1)
    break;
    if(judge()==2)
    printf("%c",in[i]);
    if(judge()==3)
    function();
    }
    return 0;
    }

  • 0
    @ 2015-09-21 00:51:43

    测试数据 #0: Accepted, time = 0 ms, mem = 432 KiB, score = 10

    测试数据 #1: Accepted, time = 0 ms, mem = 432 KiB, score = 10

    测试数据 #2: WrongAnswer, time = 0 ms, mem = 432 KiB, score = 0

    测试数据 #3: Accepted, time = 0 ms, mem = 432 KiB, score = 10

    测试数据 #4: WrongAnswer, time = 0 ms, mem = 432 KiB, score = 0

    测试数据 #5: WrongAnswer, time = 0 ms, mem = 432 KiB, score = 0

    测试数据 #6: Accepted, time = 0 ms, mem = 432 KiB, score = 10

    测试数据 #7: Accepted, time = 0 ms, mem = 432 KiB, score = 10

    测试数据 #8: Accepted, time = 15 ms, mem = 432 KiB, score = 10

    测试数据 #9: Accepted, time = 0 ms, mem = 432 KiB, score = 10

    求测试数据

  • 0
    @ 2015-08-23 16:03:30

    var answer,s:ansistring;p1,p2,p3,i,n:longint;b:array[0..1000]of boolean;
    function inabc(ll,rr:longint):boolean;
    begin
    if(s[ll]in['a'..'z'])and(s[rr]in['a'..'z'])then
    exit(true);
    end;
    function pd(left,right:longint):boolean;
    begin
    if(s[left]in['a'..'z'])and(s[right]in['a'..'z'])then
    exit(true);
    if(s[left]in['0'..'9'])and(s[right]in['0'..'9'])then
    exit(true);
    exit(false);
    end;
    procedure writ(l,r:longint);
    var ch:char;ii,f:longint;
    begin
    answer:='';
    if not pd(l,r) then
    begin
    if b[l] then begin write(s[l]);b[l]:=false;end;
    if b[l+1] then begin write(s[l+1]);b[l+1]:=false;end;
    if b[r] then begin write(s[r]);b[r]:=false;end;
    exit;
    end;
    if s[r]=succ(s[l]) then
    begin
    if b[l] then begin write(s[l]);b[l]:=false;end;
    if b[l+1] then b[l+1]:=false;
    if b[r] then begin write(s[r]);b[r]:=false;end;
    exit;
    end;
    if s[r]=s[l] then
    begin
    if b[l] then begin write(s[l]);b[l]:=false;end;
    if b[l+1] then begin write(s[l+1]);b[l+1]:=false;end;
    if b[r] then begin write(s[r]);b[r]:=false;end;
    exit;
    end;
    if s[l]>s[r] then
    begin
    if b[l] then begin write(s[l]);b[l]:=false;end;
    if b[l+1] then begin write(s[l+1]);b[l+1]:=false;end;
    if b[r] then begin write(s[r]);b[r]:=false;end;
    exit;
    end;
    if b[l] then begin write(s[l]);b[l]:=false;end;
    if p3=1 then
    begin
    answer:='';
    for ch:=succ(s[l]) to pred(s[r]) do
    for ii:=1 to p2 do answer:=answer+ch;
    end
    else if p3=2 then
    begin
    answer:='';
    for ch:=pred(s[r]) downto succ(s[l]) do
    for ii:=1 to p2 do answer:=answer+ch;
    end;
    if p1=2 then
    if inabc(l,r) then
    begin
    f:=length(answer);
    for ii:=1 to f do
    answer[ii]:=chr(ord(answer[ii])-32);
    end;
    if p1=3 then
    begin
    f:=length(answer);answer:='';
    for ii:=1 to f do answer:=answer+'*';
    end;
    write(answer);
    if b[r] then begin write(s[r]);b[r]:=false;end;
    if b[l+1] then b[l+1]:=false;
    end;
    begin
    readln(p1,p2,p3);readln(s);n:=length(s);
    fillchar(b,sizeof(b),true);
    for i:=1 to n-2 do
    if (s[i+1]='-') then writ(i,i+2)
    else if b[i] then begin write(s[i]);b[i]:=false;end;
    if b[n-1] then write(s[n-1]);
    if b[n] then write(s[n]);
    end.

    • @ 2015-08-23 16:03:51

      为甚差一个点 ac不掉

  • 0
    @ 2015-08-20 16:41:27

    #include<stdio.h>
    #include<math.h>
    #include<stdlib.h>

    char s[100001];

    main()
    {
    int p1,p2,p3;
    long i,j,k,len;
    char x;
    scanf("%d %d %d",&p1,&p2,&p3);
    len=0;
    scanf("%c",&x);
    x='0';
    s[0]='A';
    while (x!='\n')
    {
    scanf("%c",&x);
    if (x=='\n') break;
    len++;
    s[len]=x;
    }
    for (i=1;i<=len;i++)
    {
    if (s[i]!='-') printf("%c",s[i]);
    else if (((s[i-1]>='0')&&(s[i-1]<='9'))&&((s[i+1]>='0')&&(s[i+1]<='9')))
    {
    if (s[i-1]>=s[i+1]) printf("%c",s[i]);
    else
    {
    if (p1!=3)
    {
    if (p3==1)
    {
    for (j=s[i-1]-'0'+1;j<=s[i+1]-'0'-1;j++)
    for (k=1;k<=p2;k++) printf("%d",j);
    }
    else
    {
    for (j=s[i+1]-'0'-1;j>=s[i-1]-'0'+1;j--)
    for (k=1;k<=p2;k++) printf("%d",j);
    }
    }
    else
    {
    for (j=s[i-1]-'0'+1;j<=s[i+1]-'0'-1;j++)
    for (k=1;k<=p2;k++) printf("*");
    }
    }
    }
    else if (((s[i-1]>='a')&&(s[i-1]<='z'))&&((s[i+1]>='a')&&(s[i+1]<='z')))
    {
    if (s[i-1]>=s[i+1]) printf("%c",s[i]);
    else{
    if (p1==1)
    {
    if (p3==1)
    {
    for (j=s[i-1]-'a'+1;j<=s[i+1]-'a'-1;j++)
    for (k=1;k<=p2;k++) printf("%c",j+'a');
    }
    else
    {
    for (j=s[i+1]-'a'-1;j>=s[i-1]-'a'+1;j--)
    for (k=1;k<=p2;k++) printf("%c",j+'a');
    }
    }
    else if(p1==2)
    {
    if (p3==1)
    {
    for (j=s[i-1]-'a'+1;j<=s[i+1]-'a'-1;j++)
    for (k=1;k<=p2;k++) printf("%c",j+'A');
    }
    else
    {
    for (j=s[i+1]-'a'-1;j>=s[i-1]-'a'+1;j--)
    for (k=1;k<=p2;k++) printf("%c",j+'A');
    }
    }
    else if (p1==3)
    {
    for (j=s[i-1]-'a'+1;j<=s[i+1]-'a'-1;j++)
    for (k=1;k<=p2;k++) printf("*");
    }
    }
    }
    else printf("%c",s[i]);
    }
    printf("\n");
    }

  • 0
    @ 2015-08-14 14:54:13

    #include<stdio.h>
    #include<string.h>
    int p1,p2,p3;
    char s[100001];

    int main()
    {
    int l;
    scanf("%d%d%d%s",&p1,&p2,&p3,s);
    for(int i=0; i<strlen(s); i++)
    if(s[i]=='-')
    {
    char c1,c2;
    c1=s[i-1];
    c2=s[i+1];
    if(c1<c2)
    {
    if(c1>='0'&&c1<='9'&&c2>='0'&&c2<='9')
    {
    if(p1==3)
    {
    for(char j=c1+1; j<c2; j++)
    for(int k=1; k<=p2; k++)
    printf("*");
    }
    else
    {
    if(p3==1)
    {
    for(char j=c1+1; j<c2; j++)
    for(int k=1; k<=p2; k++)
    printf("%c",j);
    }
    else
    {
    for(char j=c2-1; j>c1; j--)
    for(int k=1; k<=p2; k++)
    printf("%c",j);
    }
    }
    continue;
    }
    if(c1>='a'&&c1<='z'&&c2>='a'&&c2<='z')
    {
    switch(p1)
    {
    case 1:
    {
    if(p3==1)
    {
    for(char j=c1+1; j<c2; j++)
    for(int k=1; k<=p2; k++)
    printf("%c",j);
    }
    else
    {
    for(char j=c2-1; j>c1; j--)
    for(int k=1; k<=p2; k++)
    printf("%c",j);
    }
    break;
    }

    case 2:
    {
    if(p3==1)
    {
    for(char j=c1-31; j<c2-32; j++)
    for(int k=1; k<=p2; k++)
    printf("%c",j);
    }
    else
    {
    for(char j=c2-33; j>c1-32; j--)
    for(int k=1; k<=p2; k++)
    printf("%c",j);
    }
    break;
    }
    case 3:
    {
    for(char j=c1+1; j<c2; j++)
    for(int k=1; k<=p2; k++)
    printf("*");
    break;
    }
    }
    continue;
    }
    }
    printf("-");
    }
    else printf("%c",s[i]);
    return 0;
    }

  • 0
    @ 2015-07-14 15:52:04

    以后做这种题要小心点了,害我wa了三次

    #include<string>
    #include<iostream>
    #include<cctype>
    using namespace std;

    string s;

    void print(char ch,int n) {
    for (int i=0;i<n;++i) cout<<ch;
    }

    bool pd(char a,char b) {
    if (a>=b) return 1;
    if (!(islower(a)&&islower(b))&&
    !(isdigit(a)&&isdigit(b))) return 1;
    return 0;
    }

    void solve(int p1,int p2,int p3) {
    for (int i=0;i<s.size();++i) {
    if (isalnum(s[i])||pd(s[i-1],s[i+1])||i==s.size()) cout<<s[i];
    else {
    if (p3==1) for (char ch=s[i-1]+1;ch<s[i+1];++ch) {
    if (p1==1)
    print(tolower(ch),p2);
    if (p1==2)
    print(toupper(ch),p2);
    if (p1==3)
    print('*',p2);
    }
    if (p3==2) for (char ch=s[i+1]-1;ch>s[i-1];--ch) {
    if (p1==1)
    print(tolower(ch),p2);
    if (p1==2)
    print(toupper(ch),p2);
    if (p1==3)
    print('*',p2);
    }
    }
    }
    }

    int main() {
    ios::sync_with_stdio(0);
    int p1,p2,p3;
    cin>>p1>>p2>>p3>>s;
    solve(p1,p2,p3);
    return 0;
    }

  • 0
    @ 2015-02-07 11:15:33

    编译成功

    测试数据 #0: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #1: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #2: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #3: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #4: Accepted, time = 0 ms, mem = 492 KiB, score = 10
    测试数据 #5: Accepted, time = 0 ms, mem = 488 KiB, score = 10
    测试数据 #6: Accepted, time = 0 ms, mem = 492 KiB, score = 10
    测试数据 #7: Accepted, time = 0 ms, mem = 492 KiB, score = 10
    测试数据 #8: Accepted, time = 0 ms, mem = 496 KiB, score = 10
    测试数据 #9: Accepted, time = 0 ms, mem = 484 KiB, score = 10
    Accepted, time = 0 ms, mem = 496 KiB, score = 100
    #include<cstring>
    #include<iostream>
    #include<cstdio>
    using namespace std;
    char a,st,ed;
    char ans[10000]={0};
    int ansed=0;
    int p1,p2,p3;
    void work()
    {
    char temp[10000]={0};
    memset(temp,0,sizeof(temp));
    int c=0;

    if(p1==1||(p1==2&&(st>='0'&&st<='9')))
    for(int j=1;j<=ed-st-1;j++)
    for(int i=1;i<=p2;i++)
    temp[c++]=st+j;
    if(p1==2&&st>'9')
    for(int j=1;j<=ed-st-1;j++)
    for(int i=1;i<=p2;i++)
    temp[c++]=st+j+('A'-'a');
    if(p1==3)
    for(int j=1;j<=ed-st-1;j++)
    for(int i=1;i<=p2;i++)
    temp[c++]='*';
    // ans[ansed++]=st;

    if(p3==1)
    for(int i=ansed;i<c+ansed;i++)

    ans[i]=temp[i-ansed];
    if(p3==2)
    {int x=c+ansed-1;
    for(int i=ansed;i<c+ansed;i++)

    ans[x--]=temp[i-ansed];
    }
    ansed+=c;
    }
    int main()
    {

    scanf("%d%d%d",&p1,&p2,&p3);scanf("\n");
    while(scanf("%c",&a))
    {

    if(a=='\n')
    break;
    if(a=='-')
    {
    scanf("%c",&ed);
    if(ed=='\n')
    {ans[ansed++]='-';
    break;}
    bool f=false;
    if(st<='9'&&st>='0'&&ed<='9'&&ed>='0'&&ed>st)
    f=true;
    if(st<='z'&&st>='a'&&ed<='z'&&ed>='a'&&ed>st)
    f=true;
    if(f)
    work(); if(!f)
    ans[ansed++]='-';ans[ansed++]=ed;st=ed;
    continue;
    }ans[ansed++]=a;
    st=a;
    }printf("%s\n",ans);
    return 0;
    }

    被一个回车折腾了好久。。。。

  • 0
    @ 2013-11-03 18:08:47

    program p1379;
    var
    p1,p2,p3:longint;
    a,b,s:char;
    ///////////////////////////////
    procedure init;
    begin

    readln(p1,p2,p3);
    end;
    //////////////////////////////////
    procedure main;
    var i,j:longint;
    begin
    read(a,s,b);
    while not(eof) do
    begin
    if s='-' then
    begin
    if (ord(a)>=ord(b)) or (a='-') or ((ord(a)<=57) and (ord(b)>=65)) then
    begin
    write(a);
    a:=s;s:=b;read(b);
    if eof then write(a,s,b);
    end
    else begin
    write(a);
    if p3=1 then
    begin
    if p1=1 then
    begin
    if ((ord(a)>=65) and (ord(b)<=90)) then
    begin
    for i:=ord(a)+33 to ord(b)+31 do
    for j:=1 to p2 do write(chr(i));
    end
    else begin
    for i:=ord(a)+1 to ord(b)-1 do
    for j:=1 to p2 do write(chr(i));
    end;
    end;
    if p1=2 then
    begin
    if (ord(a)>=97) and (ord(b)<=122) then
    begin
    for i:=ord(a)-31 to ord(b)-33 do
    for j:=1 to p2 do write(chr(i));
    end
    else begin
    for i:=ord(a)+1 to ord(b)-1 do
    for j:=1 to p2 do write(chr(i));
    end;
    end;
    if p1=3 then
    begin
    for i:=ord(a)+1 to ord(b)-1 do
    for j:=1 to p2 do write('*');
    end;

    end;
    if p3=2 then
    begin

    if p1=1 then
    begin
    if (ord(a)>=65) and (ord(b)<=90) then
    begin
    for i:=ord(b)+31 downto ord(a)+33 do
    for j:=1 to p2 do write(chr(i));
    end
    else begin
    for i:=ord(b)-1 downto ord(a)+1 do
    for j:=1 to p2 do write(chr(i));
    end;
    end;
    if p1=2 then
    begin
    if (ord(a)>=97) and (ord(b)<=122) then
    begin
    for i:=ord(b)-33 downto ord(a)-31 do
    for j:=1 to p2 do write(chr(i));
    end
    else begin
    for i:=ord(b)-1 downto ord(a)+1 do
    for j:=1 to p2 do write(chr(i));
    end;
    end;
    if p1=3 then
    begin
    for i:=ord(a)+1 to ord(b)-1 do
    for j:=1 to p2 do write('*');
    end;
    end;
    a:=b;read(s);
    if eof then write(a,s)
    else begin
    read(b);
    if eof then write(a,s,b);
    end;
    end;
    end
    else begin
    write(a);
    a:=s;s:=b;
    read(b);
    if eof then write(a,s,b);
    end;
    end;

    end;
    /////////////////////////////////
    begin
    init;
    main;
    end.

  • 0
    @ 2013-10-29 20:36:25

    PASCAL...
    这题太水...2min不会pascal照样过
    program expand;
    const a1=ord('0');a2=ord('9');b1=ord('a');b2=ord('z');

    var i,j,k,l,m,n,p,q,r,t,p1,p2,p3:longint;
    s,mid,mm:string;

    procedure expanding(x:longint);
    var g,t:longint;
    begin
    mid:='';
    for g:=ord(s[x-1])+1 to ord(s[x+1])-1 do
    for t:=1 to p2 do mid:=mid+chr(g);

    if p1=2 then if ord(s[x-1]) in [b1..b2] then
    for g:=1 to length(mid) do mid[g]:=chr(ord(mid[g])-32);

    if p1=3 then for g:=1 to length(mid) do mid[g]:='*';

    if p3=2 then
    begin

    mm:=mid;
    for g:=1 to length(mid) do mid[g]:=mm[length(mm)-g+1];
    end;

    write(mid);
    end;

    function need(x:longint):boolean;
    var g,t:longint;
    begin
    g:=ord(s[x-1]);t:=ord(s[x+1]);
    if not(((g in [a1..a2])and(t in [a1..a2]))
    or((g in [b1..b2])and(t in [b1..b2]))) then exit(false);
    if ord(s[x-1])>=ord(s[x+1])-1 then exit(false);
    exit(true);
    end;

    procedure work(x:longint);
    begin
    if s[x]<>'-' then
    begin
    write(s[x]);
    exit;
    end;

    if x>1 then
    begin
    if need(x) then
    begin
    expanding(x);
    exit;
    end else
    if ord(s[x-1])=ord(s[x+1])-1 then exit;
    end;

    write('-');
    exit;
    end;

    begin
    readln(p1,p2,p3);
    readln(s);
    s:=s+'$';
    for i:=1 to length(s)-1 do work(i);
    writeln;
    end.

  • 0
    @ 2012-09-13 22:04:40

    题目实在是太水了。。。可以看看这个18行的程序

    #include

    #include

    #include

    #include

    int p1, p2, p3; std::string str, ans;

    int main(void)

    {

    std::cin >> p1 >> p2 >> p3 >> str;

    ans += *str.begin();

    for (int i=1; i= str) || !((isdigit(str) == isdigit(str)) || (isalpha(str) == isalpha(str)))) {ans += str[i]; continue;}

    for (char p=str+1; p

  • 0
    @ 2010-04-16 10:30:46

    var

    p1,p2,p3,l,k,i:integer;

    s,ans:ansistring;

    function work(p:longint):ansistring;

    var left,right,i,j,k:longint;

    begin

    left:=ord(s[p-1]);

    right:=ord(s[p+1]);

    if left+1=right then exit('');

    if left>=right then exit('-');

    if (left=97) then exit('-');

    if (left>=97) and (right=65) and (k=97) and (k

  • 0
    @ 2010-04-16 09:42:05

    #include

    #include

    int p1,p2,p3;

    void init()

    {

    scanf("%d%d%d",&p1,&p2,&p3);

    }

    char upc(char c)

    {

    return c-32;

    }

    void optr(char p)

    {

    int i;

    if (p1==1)

    {

    for(i=1;i='a'&&p

  • 0
    @ 2010-04-09 20:03:43

    编译通过...

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

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

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

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

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

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

     ├ 错误行输出

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

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

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

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

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

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

    function ad(h1,h2,h3,a1,a2:integer):ansistring;

    var i,j:integer;

    begin

    case h1 of

    1:begin

    if h3=1 then for i:=a1+1 to a2-1 do

    for j:=1 to h2 do ad:=concat(ad,chr(i))

    else for i:=a1+1 to a2-1 do

    for j:=1 to h2 do ad:=concat(chr(i),ad);

    end;

    2:begin

    if a1>96 then begin

    if h3=1 then for i:=a1+1 to a2-1 do

    for j:=1 to h2 do ad:=concat(ad,chr(i-32))

    else for i:=a1+1 to a2-1 do

    for j:=1 to h2 do ad:=concat(chr(i-32),ad);

    end

    else begin

    if h3=1 then for i:=a1+1 to a2-1 do

    for j:=1 to h2 do ad:=concat(ad,chr(i))

    else for i:=a1+1 to a2-1 do

    for j:=1 to h2 do ad:=concat(chr(i),ad);

    end;

    end;

    3:begin

    for i:=a1+1 to a2-1 do

    for j:=1 to h2 do ad:=concat(ad,'*');

    end;

    end;

    end;

    var p1,p2,p3,t,t1,t2:integer;

    s,su,add:ansistring;

    s1,s2:char;

    begin

    readln(p1,p2,p3);

    readln(s);

    t:=pos('-',s);

    while t0 do begin

    add:='';

    su:=copy(s,0,t-1);

    write(su);

    s1:=s[t-1];

    s2:=s[t+1];

    t1:=ord(s1);

    t2:=ord(s2);

    if t1

  • 0
    @ 2009-11-08 22:13:49

    选中查看源代码:

    var p1,p2,p3:integer; s:string; ch:char; i,k,x,y,st,ed,j:integer;begin readln(p1,p2,p3); read(s); i:=1; while i1) and (i

  • 0
    @ 2009-11-08 10:24:21

    program P1379(input,output);

    const a1=['a'..'z'];

    a2=['0'..'9'];

    var s:array[1..999]of char;

    j,k,g,h,z,p1,p2,p3,i:integer;

    begin

    assign(input,'P.in');

    reset(input);

    readln(p1,p2,p3);

    z:=0;

    while not eof do

    begin

    inc(z);

    read(s[z]);

    end;

    close(input);

    for i:=1 to z do

    if s[i]'-' then write(s[i])

    else if (i=1) or (i=z) then write('-')

    else if (s='-')or(s='-') then write('-')

    else

    begin

    g:=ord(s);

    h:=ord(s);

    if (g>=h)or((sin a1)and(sin a2))or((sin a2)and(s in a1)) then write('-')

    else begin

    if p1=3 then for j:=g+1 to h-1 do for k:=1 to p2 do write('*')

    else if (h>48)and(h

  • 0
    @ 2009-11-07 10:40:14

    编译通过...

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

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

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

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

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

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

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

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

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

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

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

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

    第一次竟然忘记考虑‘--’的情况…… 终于秒杀 嘎嘎

  • 0
    @ 2009-11-04 19:25:35

    编译通过...

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

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

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

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

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

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

     ├ 错误行输出

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

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

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

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

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

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

    我想要第六组数据,可以不?

    #include

    #include

    #include

    using namespace std;

    string need;

    int p1,p2,p3;

    int temp1,temp2;

    bool check(int num)

    {

    temp1=int(need[num-1]);

    temp2=int(need[num+1]);

    if (temp1> need;

    for (i=0;i

  • 0
    @ 2009-10-31 22:07:21

    本人一向不惮于把程序写的超长,为了正确 与 可读 , 写的时候多复制粘贴了几下{}

    var

    i,j,k,n,t,p1,p2,p3:longint;

    a:array[1..255]of char;

    begin

    readln(p1,p2,p3);

    i:=1; while not eof do begin read(a[i]);inc(i) ;end; n:=i-1;

    if (p1=1)and(p3=1) then

    begin

    i:=1;while a[i]='-' do begin write('-');i:=i+1;end;i:=i+1;

    while i=ord(a))then begin write(a[i]);i:=i+2 end

    else

    begin

    for j:=ord(a)+1 to ord(a)-1 do

    for k:=1 to p2 do write(chr(j));

    i:=i+2;

    end;

    end

    else i:=i+1;

    end;

    if a[n-1]'-' then write(a[n-1]);writeln(a[n]);

    end

    else if (p1=1)and(p3=2)then

    begin

    i:=1;while a[i]='-' do begin write('-');i:=i+1;end;i:=i+1;

    while i=ord(a))then begin write(a[i]);i:=i+2 end

    else

    begin

    for j:=ord(a)-1 downto ord(a)+1 do

    for k:=1 to p2 do write(chr(j));

    i:=i+2;

    end;

    end

    else i:=i+1;

    end;

    if a[n-1]'-' then write(a[n-1]);writeln(a[n]);

    end

    else if (p1=2)and(p3=1)then

    begin

    i:=1;while a[i]='-' do begin write('-');i:=i+1;end;i:=i+1;

    while i=ord(a))then begin write(a[i]);i:=i+2 end

    else

    begin

    if a

  • 0
    @ 2009-10-29 16:03:35

    ansistring..

  • 0
    @ 2009-10-28 13:49:38

    我的猥琐流……

    procedure expand(x,y:char);

    begin

    x:=chr(ord(x)+1);

    y:=chr(ord(y)-1);

    if (p1=1) and (p3=1) then expand11(x,y)

    else if (p1=1) and (p3=2) then expand12(x,y)

    else if (p1=2) and (p3=1) and (x in ['a'..'z']) then expand21(x,y)

    else if (p1=2) and (p3=2) and (x in ['a'..'z']) then expand22(x,y)

    else if (p1=2) and (p3=1) and (x in ['0'..'9']) then expand11(x,y)

    else if (p1=2) and (p3=2) and (x in ['0'..'9']) then expand12(x,y)

    else if (p1=3) then expand3(x,y)

    end;

    然后写一个expandx,(CtrlC+CtrlV)*n......

信息

ID
1379
难度
6
分类
模拟 点击显示
标签
递交数
5989
已通过
1615
通过率
27%
被复制
10
上传者