编程介的小学生 2017-07-14 10:46 采纳率: 20.5%
浏览 744
已采纳

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.

  • 写回答

1条回答 默认 最新

  • devmiao 2017-07-29 13:55
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line