诚意
诚意如你,当一诚的态度对待

导航

 

 

一:第一个c程序案例

1:第一个c程序

 

#include <stdio.h>
int main()

{

printf("hello world");

return 0;

}

 

编译、运行:

  

结果:

  

 

2:程序框架

#include <stdio.h>

 

int main()

{

 

return 0;

}

注意:要有分号奥

不要用中文(字符串外的符合要英文字符)

3:输出

 

printf("hello world\n");

 

(1“”里面的内容叫做字符串

printf会把字符串原封不动的输出

(2)\n表示在输出结果后面换行

 4:输入

scanf("%d",&price);

二:做计算

1:%d

printf("%d",12+3)

 

---->%d说明后面有一个整数要输出在%d的位置上

2:四则运算

 

四则运算

c符合

意义

+

+

   

x

*

 

/

 

%

取余

()

()

括号

 

 

 

 

posted on 2018-09-06 23:02  诚意  阅读(119)  评论(0编辑  收藏  举报