首页 > 其他分享 >实验一 邵铭修 202383310026

实验一 邵铭修 202383310026

时间:2024-03-16 11:25:11浏览次数:29  
标签:include 3405472 blog 实验 https printf 202383310026 邵铭修 png

task1
}

点击查看代码
#include<stdio.h>
int main() {
	printf("o\n");
	printf("<H>\n");
	printf("I I\n");
	printf("o\n");
	printf("<H>\n");
	printf("I I\n");


	return 0;

![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316103510979-1614612527.png)
点击查看代码
#include<stdio.h>
int main() {
	printf(" O       O\n");
	printf("<H>     <H>\n");
	printf("I I     I I\n");


	return 0;
}
![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316103618545-754736024.png)

task2

点击查看代码
#include<stdio.h>
#include<stdlib.h>
#define _CRT_SECURE_NO_WARNINGS
 int main()
 {
 float a, b, c;
 scanf_s("%f%f%f", &a, &b, &c);

  if ((a + b > c) && (b + c > a) && (a + c > b))
		   printf("能构成三角形\n");
	 else
		   printf("不能构成三角形\n");
	
		system("pause");
	
	return 0;
 }
![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316104558773-1311175097.png)

task3

点击查看代码
![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316104808756-1778003700.png)

![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316104814131-434171678.png) ![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316104922030-1579968228.png)

task4

点击查看代码
#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
    double x, y;
    char c1, c2, c3;
    int a1, a2, a3;

    scanf("%d%d%d", &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,%lf", &x, &y);
    printf("x=%lf, y=%lf\n", x, y);

    return 0;
}

![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316105512097-806756298.png)

task5

点击查看代码
#include <stdio.h>

int main()

{
    int year;
    year = 1000000000 / (3600 * 24 * 365);
    printf("10亿秒约等于%d年\n", year);
    return 0;
}
![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316105558754-244152005.png)

task6

点击查看代码
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
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;
}
![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316105815311-733376790.png)

task7

点击查看代码
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<math.h>
#include<stdlib.h>

int main() {
    double C, F;

    while (scanf("%lf", &C) != EOF)
    {
        F = 9.0 / 5 * C + 32;
        printf("摄氏度C=%.2f时,华氏度F=%.2f\n", C, F);
        printf("\n");
    }

    return 0;
}
![](/i/l/?n=24&i=blog/3405472/202403/3405472-20240316110141232-1740139385.png)

TASK8

点击查看代码
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>


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

    return 0;
}

标签:include,3405472,blog,实验,https,printf,202383310026,邵铭修,png
From: https://www.cnblogs.com/minxzbc/p/18076838

相关文章

  • 实验 1 C语言开发实验环境和数据类型、运算符、表达式
     ......
  • ISIS外部路由实验简述
    默认情况下,level-1区域路由会传递给level-2区域,但是level-2区域路由不会传递给level-1区域。Level-2区域配置外部路由,并引入ISISLevel-1/2上把外部路由泄露给level-1区域实验拓扑图:实验基础配置:r1:syssysnamer1undoinfoenableintg0/0/0ipadd12.1.1.116qu......
  • 实验1 C语言输入输出和简单程序编写
    task1.1#include<stdio.h>intmain(){ printf("O\n"); printf("<H>\n"); printf("II\n"); printf("O\n"); printf("<H>\n"); printf("II\n"); return0;}task1.2#......
  • 实验1_C语言输入输出和简单程序应用编程
    task11#include<stdio.h>2#include<stdlib.h>3intmain()4{56printf("o\to\n");7printf("<H>\t<H>\n");8printf("II\tII\n");910system("pa......
  • 排序算法以及TOP 10(算法实验一)
    实验目的:掌握选择排序、冒泡排序、合并排序、快速排序、插入排序算法原理掌握不同排序算法时间效率的经验分析方法,验证理论分析与经验分析的一致性。问题重述(问题描述):问题一:实现选择排序、冒泡排序、合并排序、快速排序、插入排序算法问题二:生成20组数量规模为n(10万,20万......
  • 实验1
    //打印一个小人#include<stdio.h>intmain(){printf("O\n");printf("<H>\n");printf("II\n");printf("O\n");printf("<H>\n");printf("II\n");retur......
  • C语言实验1
    #include<stdio.h>#include<stdlib.h>intmain(){printf("0\n");printf("<H>\n");printf("II\n");printf("0\n");printf("<H>\n");printf("II\n......
  • C语言实验1
    #include<stdio.h>#include<stdlib.h>intmain(){printf("o\n");printf("<H>\n");printf("II\n");printf("o\n");printf("<H>\n");printf("II\......
  • 设计模式——抽象工厂实验
    抽象工厂实验实验场景:电子商务系统中创建的订单分为国内订单(DomesticOrder)和海外订单(OverseasOrder);国内订单使用人民币支付(RMBPayment),海外订单使用美元支付(USDPayment)。实验要求:设计使用抽象工厂模式来实现订单创建功能。实验内容:将订单工厂中的接口封装为order-api......
  • 实验1 C语言输入输出和简单程序编写
    task1_1.c1#include<stdio.h>2intmain()3{4printf("O\n");5printf("<H>\n");6printf("II\n");7printf("O\n");8printf("<H>\n");9prin......