C语言的Hello World
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}
C语言程序入口是Main函数,写法如下
int main() { //符号要用英文符号
程序代码...
}
把一段话打印到控制台需要**printf(内容)**完成,这是一种函数调用
printf("Hello World!"); //最后叫;结束这一行(英文符号)
双引号囊括的内容称为字符串
include <stdio.h> //引入函数库
引入系统库提供的函数包括printf
C程序的固定代码模式
#include <stdio.h>
int main() {
程序代码
}
注释文本采用
#include <stdio.h>
/*
* 多行注释
* 多行注释
*/
int main() { //单行注释
printf("Hello World!"); //单行注释
return 0; //单行注释
}