1~4题 C语言的 中国人都是活雷锋

如题所述

(1)

#include "stdio.h"
int main(void){
    printf("2 hours and 25 minutes\n%d minutes\n",2*60+25);
    return 0;
}

(2)

#include "stdio.h"
int main(void){
    printf("*******************\n");
    printf("*    c language   *\n");
    printf("*******************\n");
    return 0;
}

(3)

#include "stdio.h"
int main(void){
    double C;
    printf("Please enter the Celsius temperature:\nC=");
    scanf("%lf",&C);
    printf("The corresponding Fahrenheit temperature is %g\n",9*C/5+32);
    return 0;
}

(4)

#include "stdio.h"
#include "math.h"
int main(void){
    int n;
    double a,p;
    printf("Please enter a, n and p:\n");
    scanf("%lf%d%lf",&a,&n,&p);
    printf("Interest is %g\n",a*exp(n*log(1+p))-a);
    return 0;

}

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜