3 条题解

  • 2
    @ 2025-10-15 18:15:32
    #include<iostream>
    #include<string>
    using namespace std;
    int main()
    {
    	int a, b, c;
    	cin>>a>>b>>c;
    	cout<<b;
    	return 0;
    } 
    
    • -2
      @ 2025-10-15 18:13:51
      #include<iostream>
      #include<string>
      using namespace std;
      int main()
      {
      	string a;
      	a = "Hello,World!" 
      	cout<<a;
      	return 0;
      } 
      
      • -2
        @ 2025-8-24 20:50:10

        自动搬运

        查看原文

        来自洛谷,原作者为

        avatar 零殇
        离天下之大谱,滑天下之大稽,生天下之大草|AFO

        搬运于2025-08-24 20:50:09,当前版本为作者最后更新于2021-07-03 10:18:27,作者可能在搬运后再次修改,您可在原文处查看最新版

        自动搬运只会搬运当前题目点赞数最高的题解,您可前往洛谷题解查看更多

        以下是正文


        这是一个程序员用来测试编译环境是否正常的代码。

        首先我们来简单介绍一下输出。

        常用的有coutprintfputs这三种。

        cout所属的库为iostream

        剩下两个都属于cstdio库。

        对于库的调用,我们要在程序开始时输入#include<库名>,并独自占据一行。

        我会在下面的程序中加上注释,就是//之后的文字,不影响程序的运行。

        我们现在用三种输出来做这道题。

        上代码:

        #include<iostream>
        using namespace std;
        int main() {//表示主函数
        	cout<<"Hello,World!"<<endl;//<<endl表示换行
        	return 0;//表示结束程序
        }
        
        #include<cstdio>
        using namespace std;
        int main() {
        	printf("Hello,World!\n");//\n同样表示换行
        	return 0;
        }
        
        #include<cstdio>
        using namespace std;
        int main() {
        	puts("Hello,World!");//puts自带换行
        	return 0;
        }
        

        完结撒花~

        • 1

        信息

        ID
        6805
        时间
        1000ms
        内存
        128MiB
        难度
        1
        标签
        递交数
        23
        已通过
        12
        上传者