15 条题解

  • 2

    这一道题是入门题,我们甚至不用 cin 。 所以,我们可以直接cout<<"Hello World" ,但是这样太简单了,所以我们可以这样写:

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
      char *c="Hello World!";
      do{
      	for(int i=0;i<strlen(c);i++){
      		putchar(c[i]);
      	}
      }while(0);
      return 0;
    }
    

    绝对能过编译!!!

    • 0
      @ 2024-12-17 13:45:24

      #include<iostream> using namespace std; int main() {cout<<"Hello World!"; }

      • 0
        @ 2024-9-29 17:20:29
        #include<iostream>
        using namespace std;
        int main()
        {
         cout<<"Hello World!"; 
         return 0;
        }
        
        • 0
          printf("Hello World!")
          
          • 0
            @ 2023-12-22 13:21:06

            #include<iostream> using namespace std; int main() { cout<<hello world!<<endl; return 0; }

            • 0
              @ 2023-12-22 13:10:38

              #include<bits/stdc++.h> using namespace std; int main() { cout<<"Hello World!"; return 0; }

              • 0

                好玩爱玩

                • 0
                  @ 2023-9-23 20:45:17

                  入门题

                  此题甚至不用输入,直接输出即可,注意这是字符串,需要双引号来输出.

                  #include<bits/stdc++.h>
                  using namespace std;
                  int main(){
                          int a;
                         int b;
                          int c;
                          int d;
                          int aa;
                         int ba;
                          int ca;
                          int da;        int aaa;
                         int aab;
                          int aac;
                          int daa;        int aaaa;
                         int baaa;
                          int caaa;
                          int daaa;        int aaaaa;
                         int baaaa;
                          int caaaa;
                          int daaaa;        int aaaaaa;
                         int aaaaab;
                          int aaaaac;
                          int daaaaa;        int aww;
                         int wwb;
                          int cw;
                          int wd;
                  	cout<<"Hello,World!";
                  	return 0;
                  	
                  }
                  

                  谢谢.

                  • 0
                    @ 2023-9-23 20:42:25

                    #include<bits/stdc++.h>
                    using namespace std;
                    int main()
                    {
                    cout<<"Hello World!";
                    return 0;
                    }

                    • 0
                      @ 2023-9-23 20:40:53

                      #include<bits/stdc++.h> using namespace std; int main() { cout<<"Hello World!"; return 0; }

                      • 0
                        @ 2023-9-23 20:40:50

                        #include<bits/stdc++.h> using namespace std; int main() { cout<<"Hello World!"; return 0; }

                        • 0
                          @ 2023-9-23 20:40:47

                          #include<bits/stdc++.h> using namespace std; int main() { cout<<"Hello World!"; return 0; }

                          • 0
                            @ 2023-9-23 20:40:43

                            #include<bits/stdc++.h> using namespace std; int main() { cout<<"Hello World!"; return 0; }

                            • 0
                              @ 2023-9-23 20:40:35

                              #include<bits/stdc++.h> using namespace std; int main() { cout<<"Hello World!"; return 0; }

                              • -1
                                @ 2024-11-25 17:26:21
                                #include<iostream>
                                #include<cstring>
                                #include<cstdio>
                                #include<cstring>
                                using namespace std;
                                struct node 
                                {
                                    int data,rev,sum;
                                    node *son[2],*pre;
                                    bool judge();
                                    bool isroot();
                                    void pushdown();
                                    void update();
                                    void setson(node *child,int lr);
                                }lct[233];
                                int top,a,b;
                                node *getnew(int x)
                                {
                                    node *now=lct+ ++top;
                                    now->data=x;
                                    now->pre=now->son[1]=now->son[0]=lct;
                                    now->sum=0;
                                    now->rev=0;
                                    return now;
                                }
                                bool node::judge(){return pre->son[1]==this;}
                                bool node::isroot()
                                {
                                    if(pre==lct)return true;
                                    return !(pre->son[1]==this||pre->son[0]==this);
                                }
                                void node::pushdown()
                                {
                                    if(this==lct||!rev)return;
                                    swap(son[0],son[1]);
                                    son[0]->rev^=1;
                                    son[1]->rev^=1;
                                    rev=0;
                                }
                                void node::update(){sum=son[1]->sum+son[0]->sum+data;}
                                void node::setson(node *child,int lr)
                                {
                                    this->pushdown();
                                    child->pre=this;
                                    son[lr]=child;
                                    this->update();
                                }
                                void rotate(node *now)
                                {
                                    node *father=now->pre,*grandfa=father->pre;
                                    if(!father->isroot()) grandfa->pushdown();
                                    father->pushdown();now->pushdown();
                                    int lr=now->judge();
                                    father->setson(now->son[lr^1],lr);
                                    if(father->isroot()) now->pre=grandfa;
                                    else grandfa->setson(now,father->judge());
                                    now->setson(father,lr^1);
                                    father->update();now->update();
                                    if(grandfa!=lct) grandfa->update();
                                }
                                void splay(node *now)
                                {
                                    if(now->isroot())return;
                                    for(;!now->isroot();rotate(now))
                                    if(!now->pre->isroot())
                                    now->judge()==now->pre->judge()?rotate(now->pre):rotate(now);
                                }
                                node *access(node *now)
                                {
                                    node *last=lct;
                                    for(;now!=lct;last=now,now=now->pre)
                                    {
                                        splay(now);
                                        now->setson(last,1);
                                    }
                                    return last;
                                }
                                void changeroot(node *now)
                                {
                                    access(now)->rev^=1;
                                    splay(now);
                                }
                                void connect(node *x,node *y)
                                {
                                    changeroot(x);
                                    x->pre=y;
                                    access(x);
                                }
                                void cut(node *x,node *y)
                                {
                                    changeroot(x);
                                    access(y);
                                    splay(x);
                                    x->pushdown();
                                    x->son[1]=y->pre=lct;
                                    x->update();
                                }
                                int query(node *x,node *y)
                                {
                                    changeroot(x);
                                    node *now=access(y);
                                    return now->sum;
                                }
                                int main()
                                {
                                    scanf("%d%d",&a,&b);
                                    node *A=getnew(a);
                                    node *B=getnew(b);
                                    //边 Link
                                        connect(A,B); Cut
                                        cut(A,B);
                                   
                                        connect(A,B);
                                 cout<<"Hello World!"; 
                                    return 0;
                                }
                                
                                • 1

                                信息

                                ID
                                2
                                时间
                                1000ms
                                内存
                                256MiB
                                难度
                                4
                                标签
                                递交数
                                436
                                已通过
                                187
                                上传者