📜  c++ 到 python 代码转换器 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:56.685000             🧑  作者: Mango

代码示例5
#include 
#include
int main(void)
{
    float temper[50];
    float sum =0.0 ,average;
    int num, day=0;
    do{
        printf("Enter temperture for day %d: ", day+1);
        scanf("%f",&temper[day]);
    }
    while( temper [day++]>0);
    num = day -1;
    for (day=0; day < num; day++)
        sum += temper[day];
    average =sum/num;
    printf ("Average is % .2f"average);
}