放肆特判即可
也是哔了狗了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
// <expand.cpp> - 03/01/16 20:38:46 // This file is created by XuYike's black technology automatically. // Copyright (C) 2015 ChangJun High School, Inc. // I don't know what this program is. #include <iostream> #include <vector> #include <algorithm> #include <cstring> #include <cstdio> #include <cmath> using namespace std; typedef long long lol; int getint(){ int res=0,fh=1;char ch=getchar(); while((ch>'9'||ch<'0')&&ch!='-')ch=getchar(); if(ch=='-')fh=-1,ch=getchar(); while(ch>='0'&&ch<='9')res=res*10+ch-'0',ch=getchar(); return fh*res; } string s; int p1,p2,p3; void pt(char a){ for(int k=0;k<p2;k++){ if(p1==2&&a>='a'&&a<='z')putchar(a-'a'+'A'); else if(p1==3)putchar('*'); else putchar(a); } } int main(){ freopen("expand.in","r",stdin); freopen("expand.out","w",stdout); p1=getint(),p2=getint(),p3=getint(); getline(cin,s); int l=s.size(); for(int i=0;i<l;i++){ if(!i||i==l-1||s[i-1]=='-'||s[i+1]=='-'||s[i]!='-'||s[i-1]>=s[i+1]||s[i-1]<'a'&&s[i+1]>'9'){putchar(s[i]);continue;} if(p3==1)for(char a=s[i-1]+1;a<s[i+1];a++)pt(a); else for(char a=s[i+1]-1;a>s[i-1];a--)pt(a); } return 0; } |