刘华世的官方博客

计算学生的平均成绩

复制代码
#include <stdio.h>
#include <conio.h>

int main(int argc, char * argv[])
{
    float stu1, stu2, stu3;
    double average;

    printf("请输入3个学生的语文成绩\n");
    scanf("%f,%f,%f", &stu1, &stu2, &stu3);
    average = (stu1+stu2+stu3)/3.0;
    printf("这三个学生的平均成绩是:%6.2f\n", average);
    getchar();
    getch();
    

    return 0;
}
复制代码
posted @   pythonschool  阅读(482)  评论(0编辑  收藏  举报
努力加载评论中...
刘华世的官方博客
点击右上角即可分享
微信分享提示