Advertisement
zydhanlinnar11

Yoyo The Crypter Man 2

Aug 24th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     short int t,i,j,mir,tmp,k;
  8.     char x[9998],anu[7999],dadi[1999],ya[1999];
  9.    
  10.     cin>>t;
  11.    
  12.     for(i=0; i<t; i++) {
  13.         if(x[0] != '\0'){
  14.             memset(x,'\0',strlen(x));
  15.             memset(anu,'\0',strlen(anu));
  16.             memset(dadi,'\0',strlen(dadi));
  17.         }
  18.         cin>>x;
  19.         mir=0;
  20.         for(j=0; j<strlen(x); j++) {
  21.             if(x[j]== '/') {
  22.                 mir += 1;
  23.             } else {
  24.                 anu[(j-mir+1)]=x[(strlen(x)-1-j)];
  25.             }
  26.         }
  27.         short bin=0;
  28.         tmp=0;
  29.         for(j=1; j<=(strlen(x)-mir); j++) {
  30.     //      cout<<anu[j];
  31.             if((j<5) && ((anu[j]=='1'))) {
  32.                 bin |= 1<<(j-1);
  33.             } else if((j>5) && ((anu[j]=='1'))&&((j%5)!=0)) {
  34.                 bin |= 1<<((j%5)-1);
  35.             } else if(((j%5)==0)&&(anu[j]=='1')&&(j<=5)) {
  36.                 bin |= 1<<(j-1);
  37.                 dadi[tmp]=(char)(((int)bin)+96);
  38.                 tmp+=1;
  39.                 bin=0;
  40.             } else if(((j%5)==0)&&(anu[j]=='0')&&(j!=1)) {
  41.                 dadi[tmp]=(char)(((int)bin)+96);
  42.                 tmp+=1;
  43.                 bin=0;
  44.             } else if(((j%5)==0)&&(anu[j]=='1')&&(j>5)) {
  45.                 bin |= 1<<4;
  46.                 dadi[tmp]=(char)(((int)bin)+96);
  47.                 tmp+=1;
  48.                 bin=0;
  49.             }
  50.         }
  51.         for(k=0; k<strlen(dadi); k++){
  52.             ya[k]=dadi[strlen(dadi)-k-1];
  53.             cout<<ya[k];
  54.         }
  55.         cout<<endl;
  56.     }
  57.     return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement