首页 > 其他分享 >实验1

实验1

时间:2024-03-17 13:12:43浏览次数:18  
标签:pause return int system 实验 printf include

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

    system("pause");
    return 0;
}

#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");
    
    system("pause");
    return 0;
 } 

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

     system("pause");
     return 0;
 } 

#include <stdio.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;
}
     

#include<stdio.h>
#include<stdlib.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 = %f, y = %lf\n",x, y);

    system("pause");
    return 0;
}

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

    year = (1e9 / 60/ 60/ 24/ 365)+0.5;

    printf("10亿秒约等于%d年\n",year);
    system("pause");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.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 <stdlib.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");
    }

    system("pause");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{
    double C,F;

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

    }
    system("pause");
    return 0;


}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
    int a,b,c;
    double s,area;

    while(scanf("%d%d%d",&a,&b,&c) != EOF)
    {
        s = (a+b+c)/2.0;
        area = sqrt(s*(s-a)*(s-b)*(s-c));

        printf("a= %d,b= %d,c= %d",a,b,c);
        printf(",area= %.3f\n",area);

    }
    system("pause");
    return 0;

}

 

标签:pause,return,int,system,实验,printf,include
From: https://www.cnblogs.com/zhaozhimo/p/18078455

相关文章

  • 20231325贾罗祁 2023-2024-2《Python程序设计》实验一报告
    20231325贾罗祁2023-2024-2《Python程序设计》实验一报告课程:《Python程序设计》班级:2313姓名:贾罗祁学号:20231325实验教师:王志强实验日期:2024年3月13日必修/选修:公选课1.实验内容熟悉Python的操作学会调试程序编译循环的剪刀石头布游戏创建gitee账户并推送上传......
  • 实验1
    1#include<stdio.h>2#include<stdlib.h>3intmain()4{5printf("o\n");6printf("<H>\n");7printf("II\n");8printf("o\n");9printf("<H>\n"......
  • 实验报告1-熟悉C语言运行环境
    实验报告1实验名称:实验一熟悉C语言运行环境实验类型:验证性实验日期:2023年3月14日一、实验目的下载安装Dev-c6.0程序。了解在该系统上如何进行编辑、编译、连接和运行一个C程序。通过运行简单的C程序了解C程序的特点。二、实验硬、软件环境Windows计算机、Dev-c6.0三......
  • 实验报告一(输出简单图形&输出最大值)
    C语言程序设计——实验报告一实验项目名称:实验一熟悉C语言运行环境实验项目类型:验证性实验日期:2023年3月14日一·实验目的下载安装devc6.0程序。了解在该系统上如何进行编辑,编译,连接,和运行一个c程序。通过运行简单的c程序了解c程序的特点。二·实验硬,软件环境windows......
  • 实验1
    `#include<stdio.h>include<stdlib.h>intmain(){printf("O\n");printf("\n");printf("II\n");system("pause");return0;}``#include<stdio.h>include<stdlib.h>intmain(){printf......
  • 实验1
    #include<stdio.h>intmain(){ printf("o\n"); printf("<H>\n"); printf("II\n"); printf("o\n"); printf("<H>\n"); printf("II\n"); return0;}#inc......
  • 【二】【单片机】有关独立按键的实验
    自定义延时函数Delay分别用Delay.c文件存储Delay函数。用Delay.h声明Delay函数。每次将这两个文件复制到工程中,直接使用。//Delay.cvoidDelay(unsignedintxms)//@11.0592MHz{while(xms--){unsignedchari,j;......
  • 实验1 C语言开发环境使用和数据类型,运算符,表达式
    #include<stdio.h>intmain(){printf("O\n");printf("<H>\n");printf("II\n");return0;}#include<stdio.h>intmain(){printf("O\n");printf("<H>\n");print......
  • 瑞熙贝通实验室物联网管理平台新升级|支持远程开门视频监控与电源控制以及环境监测
    瑞熙贝通实验室智能物联网管控平台:利用“互联网+与物联网技术”有机融合,对实验室的用电安全监测、实验室环境异常监测(颗粒物监测、明火监测、可燃气体、烟雾监测、温湿度传感器、红外人体感应)、实验室人员安全准入、万物互联等进行有效感知识别,运用人脸识别、门禁系统、传感器......
  • c语言实验一
    #include<stdio.h>#include<stdlib.h>intmain(){printf("o\to\n");printf("<H>\t<H>\n");printf("II\tII\n");system("pause");return0;}#include&......