小码农

趣味编程-面向每个人的创意编程

【题目考点】

引入万能头文件 #include <bits/stdc++.h

使用命名空间std using namespace std

主函数写法,并且要写主函数的返回值

字符串常量,由双引号” “包含起来的是字符串常量。其实际类型为char*,是字符数组,存放于常量区。

cout输出:cout后面接<<再接要输出的内容。

printf输出字符串:printf(要输出的字符串)

【题解代码】

解法1:使用cout输出

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

解法2:使用printf输出

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

来源:http://www.6547.cn/blog/138
发表评论