Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as C++ by registered user xujiayu ( 5 years ago )
#include <stdio.h>
#include <conio.h>

int main()
{
		//TINH DIEM TRUNG BINH CUA MON TOA LY HOA
	float diemtoan , diemly , diemhoa;
	int hesotoan , hesoly , hesohoa;
	float diemtrungbinh;
	
	printf("\nnhap vao diem toan : ");
	scanf ("%f" , &diemtoan);
	printf("\nhap vao he so toan : ");
	scanf("%d",&hesotoan);
	printf("\nnhap vao diem hoa : ");
	scanf ("%f" , &diemhoa);
	printf("\nhap vao he so hoa : ");
	scanf("%d",&hesohoa);
	printf("\nnhap vao diem ly : ");
	scanf ("%f" , &diemly);
	printf("\nhap vao he so ly : ");
	scanf("%d",&hesoly);

	diemtrungbinh = (diemtoan * hesotoan + diemhoa * hesohoa + diemly * hesoly)/(hesotoan + hesohoa + hesoly);
	printf("\ndiem trung binh = %f", diemtrungbinh);

   getch();
   return 0;

}

 

Revise this Paste

Parent: 116822
Your Name: Code Language: