标签:i++ har ret string max pos div 模拟 const
简单模拟~
#include<bits/stdc++.h> using namespace std; const int maxn=1e6+14; int a[maxn]; unordered_map<char,int> pos; string s="_abcdefghijklmnopqrstuvwxyz."; int len; char ch[maxn]; int main () { for (int i=0;i<28;i++)pos[s[i]]=i; int n; while (scanf("%d",&n)&&n) { scanf("%s",ch); len=strlen(ch); for (int i=0;i<len;i++) a[n*i%len]=(pos[ch[i]]+i)%28; for (int i=0;i<len;i++) printf ("%c",s[a[i]]); printf ("\n"); } return 0; }
标签:i++ har ret string max pos div 模拟 const
原文地址:https://www.cnblogs.com/zhanglichen/p/12311148.html