#P1570. 2023.09.12-百度B卷第三题-函数调用

2023.09.12-百度B卷第三题-函数调用

题目描述

请你模拟函数的重载和调用

1.创建一个方法: 输入的格式为:“返回类型 方法名(变量类型1 变量名1,变量类型2 变量名2......)”,函数体省略。

2调用一个方法 输入的格式为:"方法名(变量类型1,变量类型2......)”。

请你在每次操作后给出系统反馈。

1.创建方法时,若创建成功,则输出一个字符串"Yes."。否则输出一个字符串"redefinition of xxx."

2 调用方法时 若调用成功 则输HH一个字符串"Yes." 若方法名不存在,则输出"There is no function xxx."。若方法名存在但方法内部的变量类型错误,则输出"xxx was not declared in this scope."

输入描述

第一行输入一个正整数qq,代表操作次数。

接下来的2q2*q行,每22行代表一次操作。

第一行为一个正整数opop,代表操作类型

第二行为一个字符串,代表一次操作。

1q1001 \leq q \leq 100

1op21 \leq op \leq 2

操作的字符串长度不超过100100,且格式保证合法。

输出描述

输出qq行字符串,代表每次操作系统的反馈。

样例

输入

7
1
void f(int x)
1
int g(int x,String s)
2
f(String)
1
void f(double x,double y)
2
f(double,double)
2
s(int,String)
1
void f(int y)

输出

Yes.
Yes.
f was not declared in this scope.
Yes.
Yes.
There is no function s.
redefinition of f.