1. part :验证性内容
  2.  
  3. .输出学号。
  4.  
  5. #include<stdio.h>
  6. int main(void){
  7. printf("");
  8. return ;
  9. }
  10.  
  11. .输入两个整数,求它们的乘积。
  12.  
  13. #include<stdio.h>
  14. int product(int,int);
  15. int main(void) {
  16. int x,y,s;
  17. scanf("%d%d",&x,&y);
  18. s=product(x,y);
  19. printf("The mul is:%d",s);
  20. return ;
  21. }
  22. int product(int a,int b){
  23. int mul;
  24. mul=a*b;
  25. return mul;
  26. }
  27.  
  28. .()整数相除。
  29.  
  30. include<stdio.h>
  31. int main(void){
  32. int a=,b=,c=,d,e,f;
  33. d=a/b*c;
  34. e=a*c/b;
  35. f=c/b*a;
  36. printf("d=%d,e=%d,f=%d\n",d,e,f);
  37. return ;
  38. }
  39.  
  40. ()自加、自减运算。
  41.  
  42. #include<stdio.h>
  43. int main(void){
  44. int a=,b=;
  45. printf("a++=%d\n",a++);
  46. printf("a=%d\n",a);
  47. printf("++b=%d\n",++b);
  48. printf("b=%d\n",b);
  49. return ;
  50. }
  51.  
  52. ()关系运算和逻辑运算
  53.  
  54. #include<stdio.h>
  55. int main(void){
  56. int a=,b=,c=;
  57. printf("%d,%d,%d,%d\n",a==b&&a==c,a!=b&&a!=c,a>=b&&a>=c,a<=b&&a<=c);
  58. printf("%d,%d\n",a<=b||a>=c,a==b||b==c);
  59. printf("%d,%d,%d,%d\n",!(a==b),!(a>=b),!(a>=c),!(a<=b));
  60. return ;
  61. }
  62.  
  63. part2:按要求写出符合要求的表达式,补全程序
  64.  
  65. .判断奇偶
  66.  
  67. #include<stdio.h>
  68. int main(void){
  69. int x;
  70. printf("输入一个整数:\n");
  71. scanf("%d",&x);
  72. if(x%!=)
  73. printf("是奇数");
  74. else
  75. printf("是偶数");
  76. return ;
  77. }
  78.  
  79. .根据不同的输入,显示不同提示信息。
  80.  
  81. #include<stdio.h>
  82. int main(void){
  83. int days;
  84. printf("输入一个整数:\n");
  85. scanf("%d",&days);
  86. if(<=days&&days<=)
  87. printf("weekend,fighting\n");
  88. else if(days==||days==)
  89. printf("weekend,relax~\n");
  90. else
  91. printf("Ooops,not in 1~7\n");
  92. return ;
  93. }
  94.  
  95. .根据用户输入字符,判断如果是小写字符,则转换成大写;否则保持原样。
  96.  
  97. #include<stdio.h>
  98. int main(void){
  99. char ch;
  100. printf("输入一个字符:\n");
  101. scanf("%c",&ch);
  102. if(ch>='a'&&ch<='z')
  103. ch=ch-;
  104. printf("%c\n",ch);
  105. return ;
  106. }
  107.  
  108. part3:编程练习
  109.  
  110. #include<stdio.h>
  111. int main(void){
  112. int a,b=,c=,n;
  113. printf("输入一个十进制数字:\n");
  114. scanf("%d",&n);
  115. while(n){
  116. a=n%;
  117. b=c*a+b;
  118. c=c*;
  119. n=n/;
  120. }
  121. printf("%d\n",b);
  122. return ;
  123. }
  124.  
  125. 实验总结与体会
  126. 经过亲自动手编程后发现了许多之前没有注意到的小细节,同时对概念性知识有了更好的理解,以后应该多动手实践,积极编程。

实验1 C语言开发环境使用和数据类型,运算符,表达式的更多相关文章

  1. 实验1 C语言开发环境使用和数据类型、运算符、表达式

    ♦ 实验结论 PART 1 验证性内容 问题: 1.结尾没有加“:”时回车到下一行的时候再输入下一行的语言首字对齐方式会发生变化,可以对上一行进行检查. (这一点需要在不同软件里面试一下,在机房里的软 ...

  2. 实验1 C 语言开发环境使用和数据类型、运算符、表达式

    # include <stdio.h> int main() { int x; printf("x:\n"); scanf("%d",&x) ...

  3. 实验1“C语言开发环境使用和数据类型、运算符、表达式”总结与体会

    一.实验结论 1.判断奇偶 // 程序功能: // 要求用户从键盘输入一个整数,判断其是奇数还是偶数 #include <stdio.h> int main() { int x; prin ...

  4. 实验1 C语言开发环境使用和编程初体验

    #include <stdio.h> #include <stdlib.h> int main() { printf ("202083290273\n2020 ,wh ...

  5. 实验1 C语言开发环境和数据类型、运算符、表达式

    #include <stdio.h> int main () { int x; printf("输入一个整数:\n"); scanf("%d",&a ...

  6. 实验1c语言开发环境使用和数据类型,运算符和表达式

    /*this is first c program*/ # include<stdio.h> int main() { printf("Hello Mars!"); ; ...

  7. 实验1C语言开发环境使用和数据类型、运算符、表达式

    # include <stdio.h> int main() { char ch; printf("输入一个字符:\n"); scanf("%c", ...

  8. 实验1 C语言开发环境...

    #include<stdio.h> int main(){ int days; printf("输入一个整数:\n") ; scanf("%d",& ...

  9. 实验1 C语言环境使用和数据类型 运算符 表达式

    Part1 经过练习我发现自己经长会漏掉分号,有时输入法不同,打出来的括号前后不同,还有转义字符的使用,大小写转化之间的表达.还有打字速度比较慢. Part2 #include<stdio.h& ...

随机推荐

  1. 马昕璐 201771010118《面向对象程序设计(java)》第六周学习总结

    第一部分:理论知识学习部分 1.继承 继承:用已有类来构建新类的一种机制.当定义了一个新类继承了一个类时,这个新类就继承了这个类的方法和域,同时在新类中添加新的方法和域以适应新的情况. 继承是Java ...

  2. jquery各版本

    各版本下载: https://www.jb51.net/zt/jquerydown.htm

  3. discuz 修改亮剑积分商城2.91模板(在常用设置中添加商场首页排序方式的背景颜色)

    在应用 -> 积分商城 -> 常用设置 中添加 商场首页排序方式 的背景颜色修改功能 步骤: 1.找到并打开此页面对应的模板source\plugin\aljsc\template\set ...

  4. CentOS启动docker1.13失败(Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.)

    一.启动失败 1.启动docker [root@localhost ~]# systemctl start docker Job for docker.service failed because t ...

  5. 火狐浏览器安装firebug和firepath插件方法(离线)

    1.下载FF55以内版本安装包,安装后在Firefox 更新选择"不检查更新" 2.火狐浏览器各个版本下载地址:http://ftp.mozilla.org/pub/firefox ...

  6. Codeforces 785 - A/B/C/D/E - (Undone)

    链接:https://codeforces.com/contest/785 A - Anton and Polyhedrons #include<bits/stdc++.h> using ...

  7. JAVA RPC(一)RPC入门

    为什么要写这个RPC 市面上常见的RPC框架很多,grpc,motan,dubbo等,但是随着越来越多的元素加入,复杂的架构设计等因素似使得这些框架就想spring一样,虽然号称是轻量级,但是用起来却 ...

  8. Confluo: Distributed Monitoring and Diagnosis Stack for High-speed Networks

    https://rise.cs.berkeley.edu/blog/confluo-millisecond-level-queries-on-large-scale-streaming-data/ht ...

  9. luogu4643 [国家集训队]阿狸和桃子的游戏

    题目链接:洛谷 这道题乍一看非常的难,而且题目标题上的标签让人很害怕. 但其实这道题并不难写(只要想到了...emm) 因为我们只需要知道两个人得分之差,所以我们可以对条件进行变换. 我们将边权平分到 ...

  10. STP(Spanning Tree Protocol)

    STP生成树协议   问题 为了提高网络的可用性,需要进行冗余和备份.但是冗余路径会产生环路 环路会导致以下问题 广播风暴:由于交换机会对广播.多播.和未知目标MAC的单播包进行泛洪,在存在环路的情况 ...