小编Mee*_*ngh的帖子

在我输入一个字母并按回车键之前,printf 不会给出输出

#include <stdio.h>
#include <math.h>

int main() {
    float g1, g2, c1, c2, dismul, cadd, csub, dis;

    printf("Enter the latitudes of the places (L1 and L2): ");
    scanf("%f %f", &c1 ,&c2);
    printf("Enter the longitudes of the places (G1 and G2): ");
    scanf("%f %f ", &g1, &g2);
    cadd = cos(c1 + c2);
    csub = cos(g2-g1);
    dismul = cadd * csub;
    dis = 3963 * acos(dismul);
    printf("The distance between the places is:%f\n", dis);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

我写了这段代码来给出两点之间的距离,但是当我运行它时,它不会给出最后一个,printf直到我输入任何字母并按回车键。

c printf output

3
推荐指数
1
解决办法
69
查看次数

标签 统计

c ×1

output ×1

printf ×1