编程介的小学生 2017-12-06 16:18 采纳率: 20.5%
浏览 918
已采纳

Configuration files

Problem Description
In daily project development process, we often use to the configuration file. Now we are going to solve the problem is simple. It is a complete configuration files writing and reading operation and output operation results.

Input
The input contains multiple test cases.The first line has one integer N (1 <= N<= 100), represent the number of the test cases.The second line has one integer M (1 <= M <= 2600) ,represent configuration files contain the M line data. The following next M line data represent the content of configuration files. The next line has one integer K (1 <= K <= 10000), represent the number of the operations. Then next K lines follow, each line represent a operation.there are two format in the operations. The first format is “op nodeName variable Name value “ . The second format is “op nodeName variableName”. If op is “U” that represent that it is the Update operation. If op is “G” that represent that it is the Get operation. If op is “I” that represent that it is the Insert operation. The node’s format in the configuration is “[nodeName]”. The format of the value is “variableName=value”. The nodeName, variableName in the configuration files all consist of lowercase character and each of them most contain 100 characters(include 100). The value consist of printable characters and most contain 100 characters(include 100) There may have some whitespaces (space or Tab key) front or behind the nodeName, variableName and value. There may have multiple same variables in the same node in the configuration file and the value of the variable to last shall prevail and the variable names and node name may be the same, in a configuration file won't exist in the same node name, inserting operations if a specified node name designated variables are the already existing failured.

Output
For each case, firstly print the “case n:” n represent the number of the case.Then operate according to the output corresponding operation results, to “U” operation if successfully output “update succeed.” otherwise output “update failured.”,to “I” operation if successful ouput “insert succeed.” otherwise ouput “insert failured.” for “G” operation if successful output a specified node specified under the value of the variable, or output “not get the value.”.

Sample Input
1
10
[appinfo]
appid = 32152
post = 86,87,89
[userinfo]
name = acmer
password = 2536LR
[softversion]
version =3.0.1
date= 2011-2-20
developers = ACM_DIY
11
U appinfo appid 12345
G appinfo appid
I test value 110alcm
G test value
G userinfo password
G userinf name
I softversion version 3.0.5
G softversion version
U softversion date 2011-2-14
G softversion versio
G softversion Date

Sample Output
case 1:
update succeed.
12345
insert succeed.
110alcm
2536LR
not get the value.
insert failured.
3.0.1
update succeed.
not get the value.
not get the value.

  • 写回答

2条回答 默认 最新

  • threenewbee 2018-02-12 16:05
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题