if和else if

#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#include<stdbool.h>
int main() {
    double x=0.2;
    bool is_data=true;//false
    int a=9;
    int b=8;
    if(a>b){
        printf("5.返回弧度角 x 的余弦。%.2f\n",cos(a));
    }
    else if(a<b){
        printf("%.2f\n",a); 
    };
    return 0;
}

 

#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#include<stdbool.h>
int main() {
    double x=0.2;
    bool is_data=true;//false
    int a=9;
    int b=8;
    if(a>b){
        printf("5.返回弧度角 x 的余弦。%.2f\n",cos(a));
    }
    else if(a<b){
        printf("%.2f\n",a); 
    }
    else
    {
        printf("哈哈");
    };
    return 0;
}

 

posted @ 2025-03-27 16:41  华腾智算  阅读(4)  评论(0)    收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL