zoukankan      html  css  js  c++  java
  • c语言 12-2

    1、

    #include <stdio.h>
    
    #define NAME_LEN 64
    
    typedef struct student{
        char name[NAME_LEN];
        int height;
        float weight;
        long schols;
    }Student;
    
    void judg(Student *x)
    {
        if(x -> height < 180)
            x -> height = 180;
        if(x -> weight > 80)
            x -> weight = 80;    
    }  
    
    int main(void)
    {
        Student sanata;    
        printf("sanata.name:  "); scanf("%s", sanata.name);
        printf("sanata.height:  "); scanf("%d", &sanata.height);
        printf("sanata.weight:  "); scanf("%f", &sanata.weight);
        printf("sanata.schols:  "); scanf("%ld", &sanata.schols);
        
        judg(&sanata);
        puts("
    ==================================
    ");
        
        printf("sanata.name:  %s
    ", sanata.name);
        printf("sanata.height:  %d
    ", sanata.height);
        printf("sanata.weight:  %.2f
    ", sanata.weight);
        printf("santa.schols:  %ld
    ", sanata.schols);
        
        return 0;
    }

  • 相关阅读:
    原生JS中Ajax的使用方法
    back-to-top回到顶部
    atom插件
    git 命令操作
    常用font-family
    上传按钮美化
    mongodb
    GraphicsMagick命令
    enctype=“multipart/form-data”详解
    操作符
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/14852408.html
Copyright © 2011-2022 走看看