实验1 c语言开发环境使用和数据类型 运算符 表达式
#include<stdio.h>
#include<stdlib.h>
int main()
{
printf(" O\n");
printf("<H>\n");
printf("I I\n");
system("pause");
return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
printf(" O\n");
printf("<H>\n");
printf("I I\n");
printf(" O\n");
printf("<H>\n");
printf("I I\n"); system("pause");
return 0; }

#include<stdio.h>
#include<stdlib.h>
int main()
{
printf(" O O\n");
printf("<H> <H>\n");
printf("I I I I\n"); system("pause");
return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
float a,b,c;
scanf("%f%f%f",&a,&b,&c); if((a+b>c)&&(a+c>b)&&(b+c>a))
printf("能构成三角形\n");
else
printf("不能构成三角形\n"); system("pause");
return 0; }



#include<stdio.h>
#include<stdlib.h>
int main()
{
char ans1,ans2;
printf("每次课前认真预习,课后及时复习了没?(输入y或Y表示有,输入n或N表示没有):");
ans1=getchar();
getchar();
printf("\n动手敲代码实践了没?(输入y或Y表示敲了,输入n或N表示没有敲):");
ans2=getchar();
if((ans1=='y'||ans1=='Y')&&(ans2=='y'||ans2=='Y'))
printf("\n罗马不是一天建成的,继续保持哦:)\n");
else
printf("\n罗马不是一天毁灭的,我们来建设吧\n"); system("pause");
return 0; }




无getchar 空格自动输出
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a1,a2,a3;
char c1,c2,c3;
double x,y; scanf("%d%d%d",&a1,&a2,&a3);
printf("al=%d,a2=%d,a3=%d\n",a1,a2,a3);
getchar();
scanf("%c%c%c",&c1,&c2,&c3);
printf("cl=%c,c2=%c,c3=%c\n",c1,c2,c3); scanf("%lf%lf",&x, &y);
printf("x=%lf,y=%lf\n",x, y); system("pause");
return 0;
#include<stdio.h>
#include<stdlib.h> int main()
{
int year;
int s=1e9;
double y;
y=0.5+s*1.0/(3600*24*365);
year=y; printf("10亿秒约等于%d年\n",year);
system("pause");
return 0; }

#include<stdio.h>
#include<math.h>
#include<stdlib.h> int main()
{
double x,ans; scanf("%lf",&x);
ans=pow(x,365);
printf("%.2f的365次方:%.2f\n",x,ans);
system("pause");
return 0; }
#include<stdio.h>
#include<math.h>
#include<stdlib.h> int main()
{
double x,ans; while(scanf("%lf",&x)!=EOF)
{
ans=pow(x,365);
printf("%.2f的365次方:%.2f\n",x,ans);
printf("\n");
}
system("pause");
return 0; }

#include<stdio.h>
#include<math.h>
#include<stdlib.h> int main()
{
double c,f; while(scanf("%lf",&c)!=EOF)
{
f=9*c/5+32;
printf("摄氏度c=%.2f时,华氏摄氏度f=%.2f\n",c,f);
printf("\n");
}
system("pause");
return 0; }

#include<stdio.h>
#include<math.h>
#include<stdlib.h> int main()
{
float a,b,c,s,area; while(scanf("%f%f%f",&a,&b,&c)!=EOF)
{
s=(a+b+c)/2.0;
area=sqrt(s*(s-a)*(s-b)*(s-c));
printf("三角形的面积是:%.3f",area);
printf("\n");
}
system("pause");
return 0; }

实验1 c语言开发环境使用和数据类型 运算符 表达式的更多相关文章
- 实验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语言开发环境使用和编程初体验
#include <stdio.h> #include <stdlib.h> int main() { printf ("202083290273\n2020 ,wh ...
- 实验1 C语言开发环境和数据类型、运算符、表达式
#include <stdio.h> int main () { int x; printf("输入一个整数:\n"); scanf("%d",&a ...
- 实验1c语言开发环境使用和数据类型,运算符和表达式
/*this is first c program*/ # include<stdio.h> int main() { printf("Hello Mars!"); ; ...
- 实验1C语言开发环境使用和数据类型、运算符、表达式
# include <stdio.h> int main() { char ch; printf("输入一个字符:\n"); scanf("%c", ...
- 实验1 C语言开发环境...
#include<stdio.h> int main(){ int days; printf("输入一个整数:\n") ; scanf("%d",& ...
- 实验1 C语言环境使用和数据类型 运算符 表达式
Part1 经过练习我发现自己经长会漏掉分号,有时输入法不同,打出来的括号前后不同,还有转义字符的使用,大小写转化之间的表达.还有打字速度比较慢. Part2 #include<stdio.h& ...
随机推荐
- ArrayList学习总结
1.ArrayList简介[1] ArrayList实现了List接口.ArrayList的方法实现和vector相似,只是线程不安全的. ArrayList的 size.isEmpty.get.se ...
- C++ mySQL数据库连接池(windows平台)
C++ MySQL数据库连接池 新手学了C++多线程,看了些资料练手写了C++数据库连接池小项目,自己的源码地址 关键技术点 MySQL数据库编程.单例模式.queue队列容器.C++11多线程编程. ...
- 二: sql模式(sql_mode)
# sql_mode 1 介绍 sql_mode 会影响 MySQL支持的SQL语法以及它执行的数据验证检查.通过设置sql_mode,可以完成不同严格程度 的数据校验,有效地保障数据准确性. MyS ...
- 使用OpenFeign远程调用时请求头处理报错问题
1. 错误信息 basic.result.exception.OtherException: feign error:系统异常:Content type 'multipart/form-data;bo ...
- Java -----多线程 创建线程的方式三: 实现Callable接口----JDK 5.0 新增
1 package bytezero.thread2; 2 3 import java.util.concurrent.Callable; 4 import java.util.concurrent. ...
- SSH原理与实践(二)
主页 个人微信公众号:密码应用技术实战 个人博客园首页:https://www.cnblogs.com/informatics/ 引言 在上一篇文章[ssh原理与实践(一)]中我们详细介绍了SSH两种 ...
- clickhouse快速上手和问题记录
clickhouse官方中文社区实战经验:手把手教你搭建单机clickhouse开发环境 我是用的是centOS7的虚拟机, 官方教程中的:sudo /etc/init.d/clickhouse-se ...
- vite ts 安装 js-cookie 库,vscode找不到类型说明(有波浪线),解决方案
vite ts 安装 js-cookie 库,vscode找不到类型说明(有波浪线),解决方案 先安装库 https://www.npmjs.com/package/js-cookie 再安装类型 h ...
- django项目(博客一)
一 项目开发流程 1.需求 分析架构师+产品经理+开发者组长 在跟客户谈需求之前,会大致先了解客户的需求,然后自己先设计一套比较好的方案 在跟客户沟通交流中引导客户往我们之前想好的方案上面靠 形成一个 ...
- 崩溃bug日志总结2
目录介绍 1.1 java.lang.ClassNotFoundException类找不到异常 1.2 java.util.concurrent.TimeoutException连接超时崩溃 1.3 ...
