救我。。。救急

P1246 编码

希望更丰富的展现?使用Markdown
by Billy●Herrington @ 2018-10-07 14:40:23


有毒
by 为依相逢 @ 2018-10-07 14:40:36


希望更丰富的展现?使用Markdown
by dinghongyu @ 2018-10-07 14:51:36


希望更丰富的展现?使用Markdown
by 塔罗兰 @ 2018-10-07 14:55:44


```cpp include<iostream> include<cstdio> include<string.h> include<cmath> include<map> using namespace std; char s[100001],a[7]; bool bj() { for (int j=0;j<6;j++) if (a[j]!=s[j]) return false; return true; } int main() { int sum=0,i; cin>>s; if (strlen(s)>6) { cout<<0; return 0; } int len=strlen(s); for (i=0;i<(len+1)/2;i++) { char t=s[i]; s[i]=s[len-i-1]; s[len-i-1]=t; } for (i=0;i<len;i++) a[i]='a'-1; while (!bj()) { a[0]++; i=0; while (a[i]>'z') { a[++i]++; } for (int j=i-1;j>=0;j--) a[j]=a[j+1]+1; sum++; } cout<<sum; return 0; } ```
by Mikamedo @ 2018-10-07 15:00:21


@[zlym](/space/show?uid=49453) 连Markdown都救不了你了
by Mikamedo @ 2018-10-07 15:00:43


。。。忘了用了。。。 ```cpp #include<iostream> #include<cstdio> #include<string.h> #include<cmath> #include<map> using namespace std; char s[100001],a[7]; bool bj() { for (int j=0;j<6;j++) if (a[j]!=s[j]) return false; return true; } int main() { int sum=0,i; cin>>s; if (strlen(s)>6) { cout<<0; return 0; } int len=strlen(s); for (i=0;i<(len+1)/2;i++) { char t=s[i]; s[i]=s[len-i-1]; s[len-i-1]=t; } for (i=0;i<len;i++) a[i]='a'-1; while (!bj()) { a[0]++; i=0; while (a[i]>'z') { a[++i]++; } for (int j=i-1;j>=0;j--) a[j]=a[j+1]+1; sum++; } cout<<sum; return 0; } ```
by 为依相逢 @ 2018-10-07 17:41:30


希望更丰富的展现?使用Markdown
by WDSJYX19 @ 2023-09-23 14:02:40


|