ZCMU 1721: on xh kd lh (凯撒密码,水)

xiaoxiao2021-02-28  105

1721: on xh kd lh

Time Limit: 1 Sec   Memory Limit: 128 MB Submit: 85   Solved: 76 [ Submit][ Status][ Web Board]

Description

fnmf wh mh on xh kd lh vdm ygd c`n sh lt rgh ygd x`mf cd fdh mh xh fd rgt m pht bgt m cd xtd rgt cd fd rgt    

Input

n(1<n<=100)

Output

Sample Input

102

Sample Output

42

HINT

kaisamima

Source

题目能破解意思就很水拉,

直接枚举一个范围内的凯撒密码移位数,然后会发现每个字母右移一位就是题目的拼音意思了

#include <iostream> #include <cstring> #include <stack> #include <cstdio> #include <cmath> #include <queue> #include <algorithm> #include <vector> #include <set> #include <map> const double eps=1e-8; const double PI=acos(-1.0); using namespace std; int main() { /* char a[]={"fnmf wh mh on xh kd lh vdm ygd c`n sh lt rgh ygd x`mf cd fdh mh xh fd rgt m pht bgt m cd xtd rgt cd fd rgt"}; char b[1005]; for(int i=-10;i<=10;i++) { memset(b,0,sizeof(b)); int j=0; for( j=0;j<strlen(a);j++) b[j]=a[j]+i; b[j]='\0'; printf("%s\n",b); }*/ int n; while(~scanf("%d",&n)){ int ans=0; for(int i=1;i<=n;i++) if(n%i==0) ans++; printf("%d\n",ans); } return 0; }

转载请注明原文地址: https://www.6miu.com/read-44645.html

最新回复(0)