小伙伴们,这个问题出在哪里呀

  1. img

2.

img

题目中接受多组测试数据的输入,而你的代码中只处理一组测试数据,可以通过循环判断是否读取到文件尾部来处理多组测试数据。

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

int main()
{
    double l, s;
    while(scanf("%lf", &l) != -1)
    {
        s = sqrt(3) / 4 * l * l;
        printf("%.2f", s);
    }
    return 0;
}

img

题目是可以多组数据,你就只有一组