1 条题解

  • 1
    @ 2024-10-22 22:36:12

    #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n1){ cout<<"1 ^ 1 = 1"; }else if(n2){ cout<<"1 ^ 1 = 1"<<endl; cout<<"2 ^ 1 = 2 "<<"2 ^ 2 = 4"; }else if(n3){ cout<<"1 ^ 1 = 1"<<endl; cout<<"2 ^ 1 = 2 "<<"2 ^ 2 = 4"<<endl; cout<<"3 ^ 1 = 3 "<<"3 ^ 2 = 9 "<<"3 ^ 3 = 27"; }else if(n4){ cout<<"1 ^ 1 = 1"<<endl; cout<<"2 ^ 1 = 2 "<<"2 ^ 2 = 4"<<endl; cout<<"3 ^ 1 = 3 "<<"3 ^ 2 = 9 "<<"3 ^ 3 = 27"<<endl; cout<<"4 ^ 1 = 4 "<<"4 ^ 2 = 16 "<<"4 ^ 3 = 64 "<<"4 ^ 4 = 256"<<endl; }else if(n5){ cout<<"1 ^ 1 = 1"<<endl; cout<<"2 ^ 1 = 2 "<<"2 ^ 2 = 4"<<endl; cout<<"3 ^ 1 = 3 "<<"3 ^ 2 = 9 "<<"3 ^ 3 = 27"<<endl; cout<<"4 ^ 1 = 4 "<<"4 ^ 2 = 16 "<<"4 ^ 3 = 64 "<<"4 ^ 4 = 256"<<endl; cout<<"5 ^ 1 = 5 "<<"5 ^ 2 = 25 "<<"5 ^ 3 = 125 "<<"5 ^ 4 = 625 "<<"5 ^ 5 = 3125"<<endl; }else if(n6){ cout<<"1 ^ 1 = 1"<<endl; cout<<"2 ^ 1 = 2 "<<"2 ^ 2 = 4"<<endl; cout<<"3 ^ 1 = 3 "<<"3 ^ 2 = 9 "<<"3 ^ 3 = 27"<<endl; cout<<"4 ^ 1 = 4 "<<"4 ^ 2 = 16 "<<"4 ^ 3 = 64 "<<"4 ^ 4 = 256"<<endl; cout<<"5 ^ 1 = 5 "<<"5 ^ 2 = 25 "<<"5 ^ 3 = 125 "<<"5 ^ 4 = 625 "<<"5 ^ 5 = 3125"<<endl; cout<<"6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= 387420489"<<endl;
    } return 0; }

    信息

    ID
    249
    时间
    1000ms
    内存
    256MiB
    难度
    10
    标签
    递交数
    4
    已通过
    1
    上传者