HBC225349送分题,枚举LogDB题解

不可一世的小女人 算法基础篇 38 0
题库丰富多样,涵盖各个领域,全网最全C++题库,让您在练习中不断成长!
A LogDB database is filled with facts. A fact is a name with a body consisting of a parenthesized list of names. This is similar to a function call: fact1(arg1,arg2,arg_3,4,4)thing(p1,arg2,p3)fac

    A LogDB database is filled with facts. A fact is a name with a body consisting of a parenthesized list of names. This is similar to a function call: fact1(arg1,arg2,arg_3,4,4)thing(p1,arg2,p3)fact1(arg1, arg2, arg_3, 4, 4)thing(p1, arg2, p3)fact1(arg1,arg2,arg_3,4,4)thing(p1,arg2,p3).     fact1fact1fact1 is the name of the fact and the list of names in the body are the arguments of the fact. thingthingthing is another fact.     The names in the list are separated by commas and optional whitespace. There will be at least one name in the list.     Names consist of alphanumeric characters (a-z,A-Z,0-9) plus ‘_’. However, the name of a fact and the names in the body cannot start with an ‘_’.     Names, parentheses, and commas may be preceded and followed by whitespace. However a fact or query cannot be split across lines.     Facts with different numbers of arguments are different facts.     A fact may appear multiple times in the database.     Queries are like facts except the argument list can contain variables. Variables are names that start with ‘_’.     A query searches the database for facts with the same name as the query that have the same number of arguments as the query and where the names in the fact body match the names in the query body in their respective positions.     A variable consisting of only ‘_’ is special and will match any name.     A variable other than ‘_’ will also match any name but if that variable appears more than once in a query, the names in the fact must be the same.     A query: fact1(arg1,_,_,_check,_check)fact1(arg1, _, _, _check, _check)fact1(arg1,_,_,_check,_check)     will match fact1(arg1,arg2,arg_3,4,4)fact1(arg1, arg2, arg_3, 4, 4)fact1(arg1,arg2,arg_3,4,4).     Variables are only defined in the query they appear in. They are not necessarily related if they are in different queries.

HBC225349送分题,枚举LogDB题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
全网最全C++题库,助您挑战自我,突破极限,成为编程领域的佼佼者!

标签: HBC225349送分题 枚举LogDB题解