Description
You are lucky to have two things:
1. A virus gene
2. A device that can modify genes;
So you decided to abuse virus genes ......
A virus gene is a string consisting of four characters: A, C, T, and G;
What you can do:
Insert X ST1 indicates inserting a gene segment ST1 after the I-bit of the original gene sequence (the gene segment is also composed of atcg)
Del x y indicates that gene sequences with y length are deleted from position X of the original gene sequence;
Copy indicates that the original gene is copied, And the length is doubled. The copy is followed by the original gene;
Now you have performed N operations and want to know the final genetics ......
-
-
Input
-
-
The first line contains a string st, the original virus gene;
The second row contains an integer of N, indicating N abuse operations;
The following n lines are in the same format as the topic description to ensure that the data is valid;
Output
Output the appearance of virus genes after N abuse;
Sample Input
aattccg
3
insert 1 aatt
del 2 5
copy
sample output
attccgattccg
subscripts must be considered for this question. It is not difficult, but it is very Bt. The difference between C and C ++ is here.
# include
# include
# include
int main () {char a [200002]; char B [100002]; char C [10]; int number, T; int I; int local; int begin, end; int length; int length1; scanf ("% s", & A); scanf ("% d", & number); For (t = 0; t
= Local + length1; I --) {A [I] = [I-length1] ;}for (I = 0; I