0_0_17203060_24555.cpp:1:1: error: stray '\347' in program
编程语言#include <cstdio>#include <cstring>int const MAX = 1e3 + 5;int n, m, a[MAX];struct Tree{ int lson, rson, val;}t[MAX];void Insert(int rt, int val, int idx){ if(t[rt].val < val) { if(t[rt].rson == -1) { t[rt].rson = idx; t[idx].val = val; } else Insert(t[rt].rson, val, idx); } else if(t[rt].val > val) { if(t[rt].lson == -1) { t[rt].lson = idx; t[idx].val = val; } else Insert(t[rt].lson, val, idx); }}void DFS(int rt, int val){ if(t[rt].val < val) { printf("W"); if(t[rt].rson != -1) DFS(t[rt].rson, val); } else if(t[rt].val > val) { printf("E"); if(t[rt].lson != -1) DFS(t[rt].lson, val); } else return;}int main(){ int T; scanf("%d", &T); while(T--) { memset(t, -1, sizeof(t)); scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); t[0].val = a[0]; for(int i = 1; i < n; i++) Insert(0, a[i], i); scanf("%d", &m); while(m --) { int tmp; scanf("%d", &tmp); DFS(0, tmp); printf("\n"); } }}#include <cstdio>#include <cstring>int const MAX = 1e3 + 5;int n, m, val[MAX];struct TREE{ TREE *lson, *rson; int val; TREE() { lson = NULL; rson = NULL; val = 0; }};void Insert(TREE *rt, int val){ if(val > rt -> val) { if(rt -> rson == NULL) { rt -> rson = new TREE(); rt -> rson -> val = val; } else Insert(rt -> rson, val); } if(val < rt -> val) { if(rt -> lson == NULL) { rt -> lson = new TREE(); rt -> lson -> val = val; } else Insert(rt -> lson, val); }}void DFS(TREE *rt, int tmp){ if(rt == NULL) return; if(tmp > rt -> val) { printf("W"); DFS(rt -> rson, tmp); } else if(tmp < rt -> val) { printf("E"); DFS(rt -> lson, tmp); } else return;}void Del(TREE *rt){ if(rt == NULL) return; Del(rt -> lson); Del(rt -> rson); delete rt;}int main(){ int T; scanf("%d", &T); while(T --) { TREE *root = new TREE(); scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &val[i]); root -> val = val[0]; for(int i = 1; i < n; i++) Insert(root, val[i]); scanf("%d", &m); while(m --) { int tmp; scanf("%d", &tmp); DFS(root, tmp); printf("\n"); } Del(root); }}
^
0_0_17203060_24555.cpp:1:1: error: stray '\274' in program
0_0_17203060_24555.cpp:1:1: error: stray '\226' in program
0_0_17203060_24555.cpp:1:1: error: stray '\347' in program
0_0_17203060_24555.cpp:1:1: error: stray '\250' in program
0_0_17203060_24555.cpp:1:1: error: stray '\213' in program
0_0_17203060_24555.cpp:1:1: error: stray '\350' in program
0_0_17203060_24555.cpp:1:1: error: stray '\257' in program
0_0_17203060_24555.cpp:1:1: error: stray '\255' in program
0_0_17203060_24555.cpp:1:1: error: stray '\350' in program
0_0_17203060_24555.cpp:1:1: error: stray '\250' in program
0_0_17203060_24555.cpp:1:1: error: stray '\200' in program
0_0_17203060_24555.cpp:1:13: error: stray '#' in program
编程语言#include <cstdio>#include <cstring>int const MAX = 1e3 + 5;int n, m, a[MAX];struct Tree{ int lson, rson, val;}t[MAX];void Insert(int rt, int val, int idx){ if(t[rt].val < val) { if(t[rt].rson == -1) { t[rt].rson = idx; t[idx].val = val; } else Insert(t[rt].rson, val, idx); } else if(t[rt].val > val) { if(t[rt].lson == -1) { t[rt].lson = idx; t[idx].val = val; } else Insert(t[rt].lson, val, idx); }}void DFS(int rt, int val){ if(t[rt].val < val) { printf("W"); if(t[rt].rson != -1) DFS(t[rt].rson, val); } else if(t[rt].val > val) { printf("E"); if(t[rt].lson != -1) DFS(t[rt].lson, val); } else return;}int main(){ int T; scanf("%d", &T); while(T--) { memset(t, -1, sizeof(t)); scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); t[0].val = a[0]; for(int i = 1; i < n; i++) Insert(0, a[i], i); scanf("%d", &m); while(m --) { int tmp; scanf("%d", &tmp); DFS(0, tmp); printf("\n"); } }}#include <cstdio>#include <cstring>int const MAX = 1e3 + 5;int n, m, val[MAX];struct TREE{ TREE *lson, *rson; int val; TREE() { lson = NULL; rson = NULL; val = 0; }};void Insert(TREE *rt, int val){ if(val > rt -> val) { if(rt -> rson == NULL) { rt -> rson = new TREE(); rt -> rson -> val = val; } else Insert(rt -> rson, val); } if(val < rt -> val) { if(rt -> lson == NULL) { rt -> lson = new TREE(); rt -> lson -> val = val; } else Insert(rt -> lson, val); }}void DFS(TREE *rt, int tmp){ if(rt == NULL) return; if(tmp > rt -> val) { printf("W"); DFS(rt -> rson, tmp); } else if(tmp < rt -> val) { printf("E"); DFS(rt -> lson, tmp); } else return;}void Del(TREE *rt){ if(rt == NULL) return; Del(rt -> lson); Del(rt -> rson); delete rt;}int main(){ int T; scanf("%d", &T); while(T --) { TREE *root = new TREE(); scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &val[i]); root -> val = val[0]; for(int i = 1; i < n; i++) Insert(root, val[i]); scanf("%d", &m); while(m --) { int tmp; scanf("%d", &tmp); DFS(root, tmp); printf("\n"); } Del(root); }}
^
0_0_17203060_24555.cpp:1:30: error: stray '#' in program
编程语言#include <cstdio>#include <cstring>int const MAX = 1e3 + 5;int n, m, a[MAX];struct Tree{ int lson, rson, val;}t[MAX];void Insert(int rt, int val, int idx){ if(t[rt].val < val) { if(t[rt].rson == -1) { t[rt].rson = idx; t[idx].val = val; } else Insert(t[rt].rson, val, idx); } else if(t[rt].val > val) { if(t[rt].lson == -1) { t[rt].lson = idx; t[idx].val = val; } else Insert(t[rt].lson, val, idx); }}void DFS(int rt, int val){ if(t[rt].val < val) { printf("W"); if(t[rt].rson != -1) DFS(t[rt].rson, val); } else if(t[rt].val > val) { printf("E"); if(t[rt].lson != -1) DFS(t[rt].lson, val); } else return;}int main(){ int T; scanf("%d", &T); while(T--) { memset(t, -1, sizeof(t)); scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); t[0].val = a[0]; for(int i = 1; i < n; i++) Insert(0, a[i], i); scanf("%d", &m); while(m --) { int tmp; scanf("%d", &tmp); DFS(0, tmp); printf("\n"); } }}#include <cstdio>#include <cstring>int const MAX = 1e3 + 5;int n, m, val[MAX];struct TREE{ TREE *lson, *rson; int val; TREE() { lson = NULL; rson = NULL; val = 0; }};void Insert(TREE *rt, int val){ if(val > rt -> val) { if(rt -> rson == NULL) { rt -> rson = new TREE(); rt -> rson -> val = val; } else Insert(rt -> rson, val); } if(val < rt -> val) { if(rt -> lson == NULL) { rt -> lson = new TREE(); rt -> lson -> val = val; } else Insert(rt -> lson, val); }}void DFS(TREE *rt, int tmp){ if(rt == NULL) return; if(tmp > rt -> val) { printf("W"); DFS(rt -> rson, tmp); } else if(tmp < rt -> val) { printf("E"); DFS(rt -> lson, tmp); } else return;}void Del(TREE *rt){ if(rt == NULL) return; Del(rt -> lson); Del(rt -> rson); delete rt;}int main(){ int T; scanf("%d", &T); while(T --) { TREE *root = new TREE(); scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &val[i]); root -> val = val[0]; for(int i = 1; i < n; i++) Insert(root, val[i]); scanf("%d", &m); while(m --) { int tmp; scanf("%d", &tmp); DFS(root, tmp); printf("\n"); } Del(root); }}
^
0_0_17203060_24555.cpp:1:1277: error: stray '#' in program
编程语言#include <cstdio>#include <cstring>int const MAX = 1e3 + 5;int n, m, a[MAX];struct Tree{ int lson, rson, val;}t[MAX];void Insert(int rt, int val, int idx){ if(t[rt].val < val) { if(t[rt].rson == -1) { t[rt].rson = idx; t[idx].val = val; } else Insert(t[rt].rson, val, idx); } else if(t[rt].val > val) { if(t[rt].lson == -1) { t[rt].lson = idx; t[idx].val = val; } else Insert(t[rt].lson, val, idx); }}void DFS(int rt, int val){ if(t[rt].val < val) { printf("W"); if(t[rt].rson != -1) DFS(t[rt].rson, val); } else if(t[rt].val > val) { printf("E"); if(t[rt].lson != -1) DFS(t[rt].lson, val); } else return;}int main(){ int T; scanf("%d", &T); while(T--) { memset(t, -1, sizeof(t)); s
|