Mã chấm: 269609
Main.cc:12:14: error: expected ‘;’ at end of member declaration mautest *a->next; ^ Main.cc:12:14: error: redeclaration of ‘mautest* mautest::a’ Main.cc:11:20: note: previous declaration ‘long long int mautest::a [100]’ long long a[MAX]; ^ Main.cc:12:15: error: expected unqualified-id before ‘->’ token mautest *a->next; ^~ Main.cc: In function ‘mt input(int, long long int, long long int, long long int*)’: Main.cc:17:7: error: request for member ‘n’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) a.n = m; ^ Main.cc:18:7: error: request for member ‘x’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) a.x = x; ^ Main.cc:19:7: error: request for member ‘y’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) a.y = y; ^ Main.cc:20:26: error: request for member ‘n’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) for(int i = 0; i < a.n; i++){ ^ Main.cc:21:11: error: request for member ‘a’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) a.a[i] = b[i]; ^ Main.cc:23:8: error: ‘mt {aka struct mautest}’ has no member named ‘next’ a->next = NULL; ^~~~ Main.cc:24:12: error: could not convert ‘a’ from ‘mt* {aka mautest*}’ to ‘mt {aka mautest}’ return a; ^ Main.cc: In function ‘void createtest(mt*)’: Main.cc:30:26: error: request for member ‘n’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) for(int i = 0; i < a.n; i++){ ^ Main.cc:31:30: error: request for member ‘n’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) for(int j = 0; j < a.n; j++){ ^ Main.cc:33:21: error: request for member ‘a’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) while(a.a[j]%10!=0){ ^ Main.cc:36:26: error: request for member ‘a’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) b[i][j] = (a.a[i]*pow(10,k)) + a.a[j]; ^ Main.cc:36:46: error: request for member ‘a’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) b[i][j] = (a.a[i]*pow(10,k)) + a.a[j]; ^ Main.cc:37:24: error: request for member ‘x’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) if(b[i][j]>=a.x && b[i][j]<=a.y) ^ Main.cc:37:40: error: request for member ‘y’ in ‘a’, which is of pointer type ‘mt* {aka mautest*}’ (maybe you meant to use ‘->’ ?) if(b[i][j]>=a.x && b[i][j]<=a.y) ^ In file included from /usr/include/stdlib.h:31:0, from /usr/include/c++/7/bits/std_abs.h:38, from /usr/include/c++/7/cmath:47, from /usr/include/c++/7/math.h:36, from Main.cc:3: Main.cc: In function ‘int main()’: Main.cc:46:12: error: conversion from ‘long int’ to non-scalar type ‘mt {aka mautest}’ requested mt a = NULL; ^ Main.cc:52:32: warning: too many arguments for format [-Wformat-extra-args] scanf("%lldlld", &x, &y); ^ Main.cc:56:13: error: conflicting declaration ‘mt* b’ mt *b = input(m, x, y, b); ^ Main.cc:50:19: note: previous declaration as ‘long long int b [m]’ long long b[m]; ^ Main.cc:57:13: error: no match for ‘operator==’ (operand types are ‘mt {aka mautest}’ and ‘long int’) if(a==NULL){ ^ Main.cc:58:17: error: no match for ‘operator=’ (operand types are ‘mt {aka mautest}’ and ‘long long int [m]’) a = b; ^ Main.cc:7:16: note: candidate: mautest& mautest::operator=(const mautest&) typedef struct mautest{ ^~~~~~~ Main.cc:7:16: note: no known conversion for argument 1 from ‘long long int [m]’ to ‘const mautest&’ Main.cc:7:16: note: candidate: mautest& mautest::operator=(mautest&&) Main.cc:7:16: note: no known conversion for argument 1 from ‘long long int [m]’ to ‘mautest&&’ Main.cc:60:13: error: no match for ‘operator!=’ (operand types are ‘mt {aka mautest}’ and ‘long int’) if(a!=NULL){ ^ Main.cc:61:14: error: base operand of ‘->’ has non-pointer type ‘mt {aka mautest}’ a->next = b; ^~ Main.cc:65:21: error: cannot convert ‘mt {aka mautest}’ to ‘mt* {aka mautest*}’ for argument ‘1’ to ‘void createtest(mt*)’ createtest(a); ^ Main.cc:66:14: error: base operand of ‘->’ has non-pointer type ‘mt {aka mautest}’ a = a->next; ^~ Main.cc:45:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] int n; scanf("%d", &n); ~~~~~^~~~~~~~~~ Main.cc:51:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &m); ~~~~~^~~~~~~~~~ Main.cc:52:14: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lldlld", &x, &y); ~~~~~^~~~~~~~~~~~~~~~~~~ Main.cc:54:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld", &b[i]); ~~~~~^~~~~~~~~~~~~~~