首页 > 其他分享 >实验1

实验1

时间:2024-09-25 22:35:36浏览次数:1  
标签:10 main return int 实验 printf include

实验1

#include int main() { printf(" O \n"); printf("\n"); printf("I I\n"); return 0; } #include int main() { printf(" O \n"); printf("\n"); printf("I I\n"); printf(" O \n"); printf("\n"); printf("I I\n"); return 0; }

运行过程

 

实验2

#include int main() { double a, b, c; scanf("%lf%lf%lf", &a, &b, &c); if((a+b>c)&&(b+c>a)&&(a+c>b)) printf("能构成三角形\n"); else printf("不能构成三角形\n"); return 0; }

 运行过程

 

 

实验3

#include 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"); return 0; }

运行过程

实验4

 

#include int main() { double x, y; char c1, c2, c3; int a1, a2, a3; scanf("%d\n%d\n%d\n", &a1, &a2, &a3); printf("a1 = %d, a2 = %d, a3 = %d\n", a1,a2,a3); scanf("%c%c%c", &c1, &c2, &c3); printf("c1 = %c, c2 = %c, c3 = %c\n", c1, c2, c3); scanf("%lf\n%lf", &x, &y); printf("x = %lf, y = %lf\n",x, y); return 0; }

运行过程

实验5

 

#include int main() { int year; int theyear = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10; year = theyear / 31536000; if (theyear % 31536000 >= 15768000) year++; printf("10亿秒约等于%d年\n", year); return 0; }

运行过程

实验6

 

#define _CRT_SECURE_NO_WARNINGS #include #include int main() { double x, ans; while (scanf("%lf", &x) != EOF) { ans = pow(x, 365); printf("%.2f的365次方: %.2f\n", x, ans); printf("\n"); } return 0; }

运行过程

实验7

 

#include using namespace std; int main() { double c, f; while (scanf("%lf", &c) != EOF) { f = c * 9 / 5; f = f + 32; printf("摄氏度c=%.2f时,华氏度f=%.2f",c,f); printf("\n"); } return 0; }

运行过程

实验8

 

#include #include int main() { int a, b, c; double s,area; while (scanf("%d %d %d", &a, &b, &c) != EOF) { s = ((double)(a + b + c)) / 2; area = sqrt(s * (s - a) * (s - b) * (s - c)); printf("a = %d,b = %d,c = %d,area = %.3lf\n\n", a, b, c, area); printf("\n"); } return 0; }

运行过程

 

标签:10,main,return,int,实验,printf,include
From: https://www.cnblogs.com/hexu7/p/18432419

相关文章

  • 实验1_C语言输入输出和简单程序应用编程
    实验1_C语言输入输出和简单程序应用编程任务1源代码1#include<stdio.h>23intmain()4{5printf("O\n");6printf("<H>\n");7printf("II\n");89return0;10}1#include<stdio.h>23......
  • 实验1
    task1源代码11#include<stdio.h>2intmain()3{4printf("o\n");5printf("<H>\n");6printf("II\n");78printf("o\n");9printf("<H>\n");10......
  • 实验1
    任务一实现在屏幕上打印一个字符小人源码#include<stdio.h>intmain(){printf("O\n");printf("<H>\n");printf("II\n");return0;}结果编写程序使得可以在水平方向上打印出两个字符小人源码#include<stdio.h>intmain(){pri......
  • 实验1
    实验1任务11//打印一个字符小人2#include<stdio.h>3intmain()4{5printf("O\n");6printf("<H>\n");7printf("II\n");8return0;9}  任务21//从键盘上输入三个数据作为三角形边长,判断其能否构成三角形2//构成三角形的条件:任意两边之和......
  • 实验1
    任务1:源代码:1#include<stdio.h>23intmain()4{printf("o\to\n");5printf("<H>\t<H>\n");6printf("II\tII\n");78return0;9}1#include<stdio.h>2......
  • 实验一
    任务1.1#include<stdio.h>intmain(){printf("o\n");printf("<H>\n");printf("II\n");printf("o\n");printf("<H>\n");printf("II\n");}任务......
  • 实验1
    实验1源代码1#include<math.h>2intmain()3{4printf("0\n");5printf("<H>\n");6printf("II\n");7printf("0\n");8printf("<H>\n");9printf("......
  • 综合实验1 利用OpenCV统计物体数量
    一、实验简介传统的计数方法常依赖于人眼目视计数,不仅计数效率低,且容易计数错误。通常现实中的对象不会完美地分开,需要通过进一步的图像处理将对象分开并计数。本实验巩固对OpenCV的基础操作的使用,适当的增加OpenCV在图像处理方向的进阶操作,例如利用canny算子等算法进行图像分......
  • lims实验室管理软件多少钱 国内一套lims系统厂商报价
    LIMS系统介绍LIMS(LaboratoryInformationManagementSystem)即实验室信息管理系统,是专为实验室设计的一套综合管理软件。它通过自动化数据采集、样品管理、结果报告等功能,显著提升实验室的运营效率和数据准确性。随着科技的进步,LIMS系统已成为现代实验室不可或缺的一部分。......
  • SSM实验室排课系统 毕业设计源码24944
    摘要随着社会的发展,社会的方方面面都在利用信息化时代的优势。互联网的优势和普及使得各种系统的开发成为必需。本文以实际运用为开发背景,运用软件工程原理和开发方法,它主要是使用动态网页开发技术java作为系统的开发语言,MySQL作为后台数据库。整个开发过程首先对实验室排......