zoukankan      html  css  js  c++  java
  • C语言实验1

    代码1:
    //
    1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "stdio.h" int main(int argc, char* argv[]) { int a,b,sum; a = 123; b = 456; sum = a+b; printf("sum is %d ",sum); return 0; }

    代码2:
    // 实验1.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include "stdio.h"
    
    int main(int argc, char* argv[])
    {   char c1,c2;
        c1=97;
        c2=98;
        printf("c1=%c,c2=%c
    ",c1,c2);
        printf("c1=%d,c2=%d
    ",c1,c2);
        return 0;
    }

    代码3:
    // sy2.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include "stdio.h"
    
    int main(int argc, char* argv[])
    {   char c1,c2;
        c1=197;
        c2=198;
        printf("c1=%c,c2=%c
    ",c1,c2);
        printf("c1=%d,c2=%d
    ",c1,c2);
        return 0;
    }

    代码4:
    // sy2.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include "stdio.h"
    #include "math.h"
    int main(int argc, char* argv[])
    {   double x,y,z;
        scanf("%lf %lf",&x,&y);
        z=x+1/abs(y);
        printf("z=%d
    ",(int)z);
        printf("z=%15.6lf
    ",z);
        printf("z=%e
    ",z);
        return 0;
    }

  • 相关阅读:
    阿里代码检查工具
    SpringCloud 服务通信方法
    Apache ab简单使用
    H5 webSocket使用
    Java list去重 取重
    解决 spring boot Failed to decode downloaded font
    Pycharm设置快捷方式
    环境变量与文件的查找
    Linux基础
    VIM中文乱码解决
  • 原文地址:https://www.cnblogs.com/p201821440024/p/10670647.html
Copyright © 2011-2022 走看看