Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by minhtienbukai501 ( 5 years ago )
#include <stdio.h>
#include <string.h>
int main()
{
char HoTen[100][30];
int n;
printf("\nNhap so luong sinh vien: ");
scanf("%d", &n);
float Diem[100][100];
float DiemTrungBinh[100];
for (int i = 0; i < n; i++)
{
printf("\n\t===NHAP SINH VIEN THU %d===\n", i + 1);
printf("\nNhap ho Ten: ");
fflush(stdin);
gets_s(HoTen[i]);
DiemTrungBinh[i] = 0;
for (int j = 0; j < 5; j++)
{
printf("\nNhap Diem thu %d: ", j + 1);
scanf("%f", &Diem[i][j]);
DiemTrungBinh[i] += Diem[i][j];
}
DiemTrungBinh[i] /= 5;
}
for (int i = 0; i < n; i++)
{
printf("\n\t===XUAT SINH VIEN THU %d===\n", i + 1);
printf("\n%s", HoTen[i]);
for (int j = 0; j < 5; j++)
{
printf("\nDiem Thu %d = %.1f", j + 1, Diem[i][j]);
}
printf("\nDiem Trung Binh = %.1f", DiemTrungBinh[i]);
}
return 0;
}
Revise this Paste