#P1632. 函数调用
函数调用
题目描述
请你模拟函数的重载和调用
.创建一个方法: 输入的格式为:“返回类型 方法名(变量类型 变量名,变量类型 变量名......)”,函数体省略。
调用一个方法 输入的格式为:"方法名(变量类型,变量类型......)”。
请你在每次操作后给出系统反馈。
.创建方法时,若创建成功,则输出一个字符串"Yes."
。否则输出一个字符串"redefinition of xxx"
调用方法时 若调用成功 则输一个字符串"Yes."
若方法名不存在,则输出"There is no function xxx."
。
若方法名存在但方法内部的变量类型错误,则输出"xxx was not declared in this scope."
输入描述
第一行输入一个正整数,代表操作次数。
接下来的行,每行代表一次操作。
第一行为一个正整数,代表操作类型
第二行为一个字符串,代表一次操作。
操作的字符串长度不超过,且格式保证合法。
输出描述
输出行字符串,代表每次操作系统的反馈。
样例
输入
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.