#include "stdafx.h"
#include <conio.h>
#include <stdio.h>
#include <string.h>
struct date
{
int d;
int m;
int y;
};
struct diem
{
float toan;
float hoa;
float ly;
float tb;
};
typedef struct sinhvien
{
diem d;
date ns;
char hoten[30];
char masv[15];
char xeploai[30];
}sv;
void nhap1sv(sv &x)
{
printf("Ma so sinh vien:");
fflush(stdin);
gets(x.masv);
printf("Ho va ten:");
fflush(stdin);
gets(x.hoten);
printf("Nhap ngay thang nam sinh");
scanf("%d%d%d", &x.ns.d, &x.ns.m, &x.ns.y);
printf("Nhap diem toan:");
scanf("%f", &x.d.toan);
printf("Nhap diem ly:");
scanf("%f", &x.d.ly);
printf("Nhap diem hoa:");
scanf("%f", &x.d.hoa);
x.d.tb=(x.d.toan+x.d.ly+x.d.hoa)/3;
}
void xuat1sv(sv x)
{
printf("Ma so sv %15s", x.masv);
printf("Ho ten sv %s", x.hoten);
printf("Ngay thang nam sinh %d%d%d", x.ns.d, x.ns.m, x.ns.y);
printf("Diem toan %f", x.d.toan);
printf("Diem ly %f", x.d.ly);
printf("Diem hoa %f", x.d.hoa);
printf("Diem trung binh la %f", x.d.tb);
printf("Xep loai sinh vien %s", x.xeploai);
}
void nhapds(sv a[], int &n)
{
/*printf("
======================================= =========================
");*/
printf("Nhap so luong sinh vien");
scanf("%d", &n);
for (int i=0;i<n;i++)
{
printf("
Nhap thong tin sinh vien thu %d
", i+1);
nhap1sv(a[i]);
}
}
void xuatds(sv a[], int n)
{
for (int i=0; i<n; i++)
xuat1sv(a[i]);
}
void xeploaisv(sv x)
{
char Xeploai[30];
if(x.d.tb >=8)
strcpy(Xeploai,"Gioi");
else if(x.d.tb >=7)
strcpy(Xeploai,"Kha");
else
strcpy(Xeploai,"Trung binh");
strcpy(x.xeploai, "Xeploai");
}
void main()
{
sv x;
sv a[50];
int n;
nhapds(a,n);
xuatds(a,n);
getch();
}
Pallet nhựa Lâm Đồng giải pháp hoàn hảo cho nhà kho Pallet nhựa Lâm Đồng là một giải pháp đa năng và hiệu quả trong việc vận chuyển và lưu trữ hàng hóa. Trong đó, pallet nhựa Lâm Đồng không chỉ đáp...
Pallet nhựa Lâm Đồng giải pháp...