Untitled
Never
#include <stdio.h> #include <stdlib.h> #include <string.h> char alphabet[100001][26]; int main(){ char *string=(char *)malloc(sizeof(char)*1000001); char *sub=(char *)malloc(sizeof(char)*1000001); memset(sub,-1,1000001); int Q; gets(string); scanf("%d",&Q); char *A=(char *)malloc(sizeof(char)*Q); char *B=(char *)malloc(sizeof(char)*Q); char *C=(char *)malloc(sizeof(char)*Q); int *a=(int *)malloc(sizeof(int)*Q); int *b=(int *)malloc(sizeof(int)*Q); int *c=(int *)malloc(sizeof(int)*Q); short *type=(short *)malloc(sizeof(short)*Q); for(short i=0;i<Q;i++){ scanf("%hd",type+i); switch (type[i]){ case 1: scanf(" %c %c",A+i,B+i); break; case 2: scanf("%d %c",a+i,C+i); break; case 3: scanf("%d%d",b+i,c+i); break; } } for(char i='a';i<='z';i++) alphabet[Q][i-'a']=i; for(int i=Q-1;i>=0;i--){ for(short j=0;j<26;j++) alphabet[i][j]=alphabet[i+1][j]; if(type[i]==1) alphabet[i][A[i]-'a']=alphabet[i+1][B[i]-'a']; } for(int i=0;i<Q;i++) switch (type[i]){ case 2: sub[a[i]]=alphabet[i+1][C[i]-'a']; break; case 3: { char tmpc=string[b[i]]; string[b[i]]=string[c[i]]; string[c[i]]=tmpc; tmpc=sub[b[i]]; sub[b[i]]=sub[c[i]]; sub[c[i]]=tmpc; break; } } for(int i=0;string[i];i++){ if(~sub[i]) putchar(sub[i]); else putchar(alphabet[0][string[i]-'a']); } putchar('\n'); free(A); free(B); free(C); free(a); free(b); free(c); free(string); free(sub); free(type); }
Raw Text
-
Untitled
8 min ago
-
https://pgccouncilcsp.powerappsportals.us/forums/general-discussion/ad846e56-bb02-ef11-a73d-001dd806
12 min ago
-
Trashy romance
13 min ago
-
Quick Books Customer service
14 min ago
-
The Hairiest Pussy's you've ever seen!
24 min ago
-
V BUCKS GENERATOR
31 min ago
-
Furiosa: A Mad Max Saga Streamcloud Deutsch Ganzer Film
41 min ago
-
She SWALLOWED cum for MONEY!
53 min ago
-
https://twor.microsoftcrmportals.com/forums/support-forum/faf992e5-2002-ef11-a73d-6045bd3fd1cb
58 min ago
-
https://twor.microsoftcrmportals.com/forums/support-forum/faf992e5-2002-ef11-a73d-6045bd3fd1cb
59 min ago