以后会把我每天学到的东东做下笔记,看看对大家是否有用,
例1:
#include "stdio.h" /*可写成 #include <stdio.h> 中问可以不空格*/
void main() /*中问一定要空格,void不要输出结果一样,原因?*/
{
printf ( "黑叶子!" /n ) ; /*/n写和没写输出结果一样,原因? */
}#
笔记:
1、左右花括号一定要对齐吗?还是规定,试了下,除了 void main间一定要加空格外,其它地方无论空格多少都对输出结果无影响;
2、(""):一般格式/
例2:
#include "stdio.h"
void main()
{
int a,b,sum;
a=-20;
b=50; h0 _0 ~5 `" _
sum=a+b;
printf("sum=%d\n",sum);
}
1、其中:int a,b,sum;可以写成如下格式
int a;
int b;
int sum;
2、一定要是分号;
%d十进制,%o为八进制,%x为十六进制(不是h),%b不是二进制。
|