123456789101112131415161718192021222324 |
- //我是个傻逼
- #include <bits/stdc++.h>
- using namespace std;
- int decode(int c,int d,int n){int m=1;for(int i=0;i<d;i++){m=(m*c)%n;}return m;}
- char m[1024];
- int c[1024];
- int i,d,n;
- char a;
- int main(){
- cout<<"n:";
- cin>>n;
- cout<<"d:";
- cin>>d;
- cout<<"cidhertext:";
- while(scanf("%d",&c[i++])!=EOF)
- {
- a=cin.get();
- if(a!=' ') break;
- }
- for(i=0;c[i]!=0;i++){m[i]=decode(c[i],d,n);}
- cout<<m;
- system("pause");
- return 0;
- }
|