diff --git a/13307130057/assignment11/src/Deli Deli.cpp b/13307130057/assignment11/src/Deli Deli.cpp new file mode 100644 index 0000000..a5c3610 --- /dev/null +++ b/13307130057/assignment11/src/Deli Deli.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include +using namespace std; +int main() +{ + int l,n,i,j,len; + map f; + string s,s1,s2; + cin>>l>>n; + for (i=0;i>s1>>s2; + f[s1]=s2; + } + for (i=0;i>s; + if (f.count(s)) cout< +#include +using namespace std; +struct tree +{ + char name; + int lc,rc; +}; +int main() +{ + int t; + scanf("%d\n",&t); + while (t) + { + t--; + tree a[10000]; + int i,m,n,stack[10000],queue[10000]; + char c; + n=0;m=0; + c=getchar(); + while (c!='\n') + { + a[m].name=c; + if ((c>96)&&(c<123)) + { + a[m].lc=-1; + a[m].rc=-1; + } + else + { + n=n-2; + a[m].lc=stack[n]; + a[m].rc=stack[n+1]; + } + stack[n++]=m++; + c=getchar(); + } + queue[0]=m-1;n=1; + for (i=0;i=0;i--) putchar(a[queue[i]].name); + printf("\n"); + } + return 0; +} \ No newline at end of file diff --git a/13307130057/assignment11/src/Great Swerc.cpp b/13307130057/assignment11/src/Great Swerc.cpp new file mode 100644 index 0000000..adee175 --- /dev/null +++ b/13307130057/assignment11/src/Great Swerc.cpp @@ -0,0 +1,72 @@ +#include +#include +#include +using namespace std; +struct node +{ + char name; + int num,head; +}a[10]; +int t[10],sum,n,m; +string s[10]; +void work(int x) +{ + if (x==0) + { + long long tot,number; + tot=0; + for (int i=0;i>n;m=0; + for (int i=0;i>s[i]; + for (int j=0;j