实验一

#include<stdio.h>
int main()
{
    printf(" O\n");
    printf("<H>\n");
    printf("I I\n");
    printf(" \n");
    printf(" O\n");
    printf("<H>\n");
    printf("I I\n");
    printf(" \n");
    printf(" O       O\n");
    printf("<H>     <H>\n");
    printf("I I     I I\n");

    return 0;
}

实验一

task2

#include<stdio.h>
int main()
{

    float x, y;
    float r1, r2, r3, r4;

    x = 1;
    y = 2;

    r1 = x + y;
    r2 = x - y;
    r3 = x * y;
    r4 = x / y;

    printf("r1=%f\n", r1);
    printf("r2=%f\n", r2);
    printf("r3=%f\n", r3);
    printf("r4=%f\n", r4);

    return 0;
}

实验一

 task3

int main()
{

    float x, y;
    float r1, r2, r3, r4;

    x = 1;
    y = 2;

    r1 = x + y;
    r2 = x - y;
    r3 = x * y;
    r4 = x / y;

    printf("r1=%f\n", r1);
    printf("r2=%f\n", r2);
    printf("r3=%f\n", r3);
    printf("r4=%f\n", r4);

    return 0;
}

实验一

 task4

#include<stdio.h>
int main()
{
    double x, y;
    char c1, c2, c3;
    int a1, a2, a3;

    scanf_s("%d%d%d", &a1, &a2, &a3);
    printf("%d,%d,%d\n", a1, a2, a3);
    scanf_s("%lf%lf", &x, &y);
    printf("%lf,%lf", x, y);
    scanf_s("%c%c%c", &c1, &c2, &c3);
    printf("%c,%c,%c\n", c1, c2, c3);
    
    return 0;
}

实验一

 task5

#define _CRT_SECURE_NO_WARRNINGS
#include<stdio.h>
int main()
{
    int a1, a2;
    char c1, c2;

    scanf("%d%c%d%c", &a1, &c1, &a2, &c2);
    printf("a1=%d,a2=%d\n", a1, a2);
    printf("c1=%c,c2=%c\n", c1, c2);

    return 0;
}

实验一

 

实验一

 

 

上一篇:实验1


下一篇:202183290541赵麒钧实验1