求帮忙看下哪错了(原贴已被淹没无回答)
查看原帖
求帮忙看下哪错了(原贴已被淹没无回答)
35137
a___楼主2017/5/13 22:34

70(#3,#5,#6)

#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
string a;char b[20010];
int i,len,p1,p2,p3,k=0;
char j;
void pp2 (char c)
{
    for (int ppp2=0;ppp2<p2;ppp2++) b[k++]=c;
}
void pp1 ()
{
    if (p1==1) pp2 (tolower(j));
    else if (p1==2) pp2 (toupper(j));
    else pp2 ('*');
}
void pp3 ()
{
    if (p3==1)
    for (j=a[i-1]+1;j<a[i+1];j++) pp1 ();
    else
    for (j=a[i+1]-1;j>a[i-1];j--) pp1 ();
}
int main ()
{
    cin>>p1>>p2>>p3;
    getline (cin,a);
    getline (cin,a);
    len=a.size();
    for (i=0;i<len;i++)
    {
        if(i>0&&a[i]=='-')
        if(a[i-1]<a[i+1]) 
        pp3 ();
        else b[k++]=a[i];
        else b[k++]=a[i];
    }
    b[k]='\0';
    printf ("%s",b);
    return 0;
}

2017/5/13 22:34
加载中...