Orange Boy/Red Girl/Legendary Grandmeow Can You Solve It Out? Ep.2

思考题 for implementing

CPP Program

You are given a C++ Program without any compiler command (without '#'). It's made sure it will pass compilation when tested on Codeforces C++ 11 compiler after adding necessary imports.
You have to solve the problems according to your character.

For Orange Boy

You need to print the function list as example stated.
Example

using namespace std;
class SomeClass{
    public:
        void solve(){
        }
}
inline template T add(T a,T b){
    return a+b;
}
int main(){
    int x,y;
    cin>>x>>y;
    add(1,2);
    cout<

Output

SomeClass.solve arg="" ret="void" wor=""
add arg="a(T),b(T)" ret="T" wor="inline template"
main arg="" ret="int" wor=""

For Red Girl

You are asked to shorten the program as example stated.
Example

using namespace std;
long long a,b;
int main(){
    cin>>a>>b; //read two long long
    cout<<"the sum of the two long long is "<

Query: change "long long" to "ll"
Output

using namespace std;
ll a,b;
int main(){
    cin>>a>>b; //read two long long
    cout<<"the sum of the two long long is "<

For L.Meow

You are asked to make the program not recursive without changing the meaning of the original program.
Example

using namespace std;
int f(int n){
    if(n==0){
        return 1;
    }else{
        return f(n-1)*n;
    }
}
int main(){
    cout<

Output
c++
int main(){
int x=1;
for(int i=1;i<=10;i++) x*=i;
cout<<x<<endl;
}

Implementation Dragon is watching you

版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/292
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>