#include <stdio.h> int main(void) { float a,b,sum=0,avg=0; printf("请输入a和b的值:\n"); scanf("%f\n",&a); scanf("%f",&b); sum=a+b; avg=sum/2; printf("sum=%f\navg=%f\n",sum,avg); return 0; }
#include <stdio.h> int main(void) { float a,b,sum,avg; printf("请输入a和b的值:\n"); scanf("%f,%f",&a,&b); sum=a+b; avg=sum/2; printf("sum=%f\navg=%f\n",sum,avg); return 0;