实验1C语言开发环境使用和数据类型、运算符、表达式
# include <stdio.h>
int main()
{
char ch;
printf("输入一个字符:\n");
scanf("%c",&ch);
if(ch>='a'&&ch<='z')
ch=ch-'a'+'A';
printf("%c\n",ch);
return ;
}

#include <stdio.h>
int main() {
int days;
printf("输入一个整数: \n");
scanf("%d",&days); if(days>=&&days<=)
printf("workdays, fighting\n");
else if(days==||days==)
printf("weekend, relax~\n");
else
printf("Ooops, not in 1~7\n");
return ;
}



//关系运算和逻辑运算
# include<stdio.h>
int main()
{
int a=,b=,c=;
printf("%d,%d,%d,%d\n",a==b&&a==c,a!=b&&a!=c,a>=b&&a>=c,a<=b&&a<=c);
printf("%d,%d\n",a<=b||a>=c,a==b||b==c);
printf("%d,%d,%d,%d\n",!(a==b),!(a>=b),!(a>=c),!(a<=b));
return ;
}

/*Thhis is first C program*/
# include<stdio.h>
int main()
{
printf("headbchsajhcuiknlxkns");
return ;
}

/*求两个整数的乘积*/
# include<stdio.h>
int product(int,int);
int main(void)
{
int x,y,s;
scanf("%d %d",&x,&y);
s=product(x,y);
printf("The mul is:%d",s);
return ;
}
int product(int a,int b)
{
int mul;
mul=a*b;
return mul;
}

# include <stdio.h>
int main()
{
int x;
printf("输入一个整数: \n");
scanf("%d",&x); if(x%==)
printf("是奇数");
else
printf("是偶数");
return ;
}


/*整数相除*/
# include<stdio.h>
int main()
{
int a=,b=,c=,d,e,f;
d=a/b*c;
e=a*c/b;
f=c/b*a;
printf("d=%d,e=%d,f=%d\n",d,e,f);
return ;
}

/*自加、自减运算*/
# include<stdio.h>
int main()
{
int a=,b=;
printf("a++=%d\n",a++);
printf("a=%d\n",a);
printf("++b=%d\n",++b);
printf("b=%d\n",b);
return ;
}

实验1C语言开发环境使用和数据类型、运算符、表达式的更多相关文章
- 实验1c语言开发环境使用和数据类型,运算符和表达式
/*this is first c program*/ # include<stdio.h> int main() { printf("Hello Mars!"); ; ...
- 实验1 C语言开发环境使用和数据类型、运算符、表达式
♦ 实验结论 PART 1 验证性内容 问题: 1.结尾没有加“:”时回车到下一行的时候再输入下一行的语言首字对齐方式会发生变化,可以对上一行进行检查. (这一点需要在不同软件里面试一下,在机房里的软 ...
- 实验1 C 语言开发环境使用和数据类型、运算符、表达式
# include <stdio.h> int main() { int x; printf("x:\n"); scanf("%d",&x) ...
- 实验1 C语言开发环境使用和数据类型,运算符,表达式
part :验证性内容 .输出学号. #include<stdio.h> int main(void){ printf("); ; } .输入两个整数,求它们的乘积. #incl ...
- 实验1“C语言开发环境使用和数据类型、运算符、表达式”总结与体会
一.实验结论 1.判断奇偶 // 程序功能: // 要求用户从键盘输入一个整数,判断其是奇数还是偶数 #include <stdio.h> int main() { int x; prin ...
- 实验1 C语言环境使用和数据类型 运算符 表达式
Part1 经过练习我发现自己经长会漏掉分号,有时输入法不同,打出来的括号前后不同,还有转义字符的使用,大小写转化之间的表达.还有打字速度比较慢. Part2 #include<stdio.h& ...
- 研究实验1_搭建一个精简的C语言开发环境(包含部分经典的前言)
综合研究: 在这部分内容中,将启示我们如何进行独立研究和深度思考(一定要注意这一点,相应的调整自己的学习思想).同时使我们: (1)认识到汇编语言对于深入理解其他领域知识的 ...
- 实验四:Linux系统C语言开发环境学习
项目 内容 这个作业属于哪个课程 班级课程主页链接 这个作业的要求在哪里 作业要求 学号-姓名 17043133-木腾飞 作业学习要求 1.学习Linux系统中如何查看帮助文档:2.在Linux系统中 ...
- 实验四 Linux系统C语言开发环境学习
项目 内容 这个作业属于哪个课程 Linux系统与应用 这个作业的要求在哪里 作业要求链接 学号-姓名 17041428-朱槐健 作业学习目标 1.Linux系统下C语言开发环境搭建 2.学习Linu ...
随机推荐
- js取得对象的类名constructor.name
constructor 属性返回对创建此对象的数组函数的引用. 语法 object.constructor 例子 new Array().constructor//ƒ Array() { [nativ ...
- RuntimeError: Model class users.models.UserProfile doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
Django启动的时候报错 File "/home/hehecat/PycharmProjects/MxShop/MxShop/urls.py", line 23, in from ...
- python之(urllib、urllib2、lxml、Selenium+PhantomJS)爬虫
一.最近在学习网络爬虫的东西,说实话,没有怎么写过爬虫,Java里面使用的爬虫也没有怎么用过.这里主要是学习Python的时候,了解到Python爬虫的强大,和代码的简介,这里会简单的从入门看是说起, ...
- LeetCode每日一练(1-3)
题目导航 1. 两数之和 2. 两数相加 3. 无重复字符的最长子串 1. 两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的 ...
- ElementUI动态表格数据转换formatter
elementUI的表格初始化比较简单,声明prop值对应的字段名即可. 而在实际应用中,我们常常有这种需求:从服务器获取的数据并不是我们要显示的最终结果,涉及一些状态.类型.日期时间等的转换,这时候 ...
- css 垂直方向 margin 边距 重合
1:控制两个相邻边盒子之间的距离,在A或者B盒子上用margin控制,就可以控制距离了. 2:父子级之间的元素,常规文档流中,只要垂直外边距直接接触就会发生合并.比如在写header标签时,想移动he ...
- 大专生自学web前端到找到工作的经验
先做个自我介绍,我13年考上一所很烂专科民办的学校,学的是生物专业,具体的学校名称我就不说出来献丑了.13年我就辍学了,我在那样的学校,一年学费要1万多,但是根本没有人学习,我实在看不到希望,我就退学 ...
- Python中@staticmethod和@classmethod的作用和区别
简单介绍一下两者的区别: 对于一般的函数test(x),它跟类和类的实例没有任何关系,直接调用test(x)即可 #!/usr/bin/python # -*- coding:utf-8 -*- de ...
- linux内核构造skb发包-----raw、tcp网络编程
1. 内核raw发包 #include <linux/init.h>#include <linux/module.h> #include <linux/kernel.h& ...
- [ansible-playbook]离线安装ansible 2.3
痛点: 测试环境无法连上外网升级ansible 预计阅读时间:5分钟 参考文档 http://docs.ansible.com/ansible/latest/intro_installation.ht ...