4 条题解

  • 1
    @ 2025-7-30 11:57:27

    《换行输出》题解

    此题需要用C++中的输出函数——cout。 在题目《输出》中我有讲到该函数用法以及效果。 在这里,以cout为例,换行输出可以用endl。 用法如:cout<<"hello"<<endl<<"world"; 此题亦可用printf来做,如: printf("hello\nworld"); 代码在后面 PS:按照需要copy。

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        cout<<"hello"<<endl<<"cat";
        return 0;
    }
    
    
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        printf("hello\ncat");
        return 0;
    }
    
    
    • 1
      @ 2025-3-10 16:53:02

      #include<bits/stdc++.h> using namespace std; int main(){ cout<<"hello"<<endl; cout<<"cat" }

      • 1
        @ 2024-12-14 17:08:03
        • 1
          @ 2024-11-28 17:30:46
          #include<bits/stdc++.h>
          using namespace std;
          int main(){
          	cout<<""<<endl<<"";//这里写hello cat 
          }
          
          • 1

          信息

          ID
          99
          时间
          1000ms
          内存
          256MiB
          难度
          4
          标签
          (无)
          递交数
          137
          已通过
          66
          上传者