Xin chào mọi người e mới là sinh viên năm nhất mới học về c ,mọi người xem cho em đây là lỗi gì ạ
#include <stdio.h>
int main(){
printf("_________Chuong trinh menu chon________\n");
float x,diemTB;
int chon = 0;
int y;
int UCLN(int a, int b);
int BSCNN(int a, int b);
int i,tong_tien_dien;
int so,tuSo,mauSo;
int gioBD,gioKT,tien=0,tonggio;
struct SinhVien{
char hoTen[50];
struct PhanSo{
};
};
}
while(chon!=0){
printf("\nChuc nang 1: Kiem tra so nguyen ");
printf("\nChuc nang 2: Tim uoc chung va boi chung ");
printf("\nChuc nang so 3: Tinh tien hat ");
printf("\nChuc nang so 4: Tinh tien dien ");
printf("\nChuc nang so 5: Thong tin sinh vien ");
printf("\nChuc nang so 6: Tinh toan phan so ");
printf("\nXin moi ban nhap chuc nang: ");
scanf("%d",&chon);
}
switch(chon){
case 1:
printf("\nChuong trinh kiem tra so nguyen");
printf("Moi ban nhap vao so y=");
scanf("%d",&y);
printf("\n");
int landem=0;
if(x==(int )y){
printf("\nLa so nguyen ");
}else{
printf("\n%0.2f khong phai so nguyen",y)
for(int i=2;i<y;i++){
if(y%i==o){
landem++
}
}
if (landem!=0)
printf("\n%d khong phai la so nguyen to",y);
else
printf("\n%d la so nguyen to",y);
}if(i*i==x){
for(i=1;i<x;i++){
printf("\n%d la so chinh phuong",y);
landem++;
}
}
if (landem==0){
printf("\n%d khong phai la so chinh phuong");
}
case 2:
printf("Tim uoc cung va boi chung");
printf("\nMoi Ban Nhap So a : ");
scanf("%d", &a);
printf("\nMoi Ban Nhap So b : ");
scanf("%d",&b);
int UCLN(int a, int b);
int max;
for(max = a;max >= 1;max--){
if(a % max == 0 && b % max ==0){
printf("UCLN cua %d va %d la : %d\n",a,b,max);
}
}
int BSCNN(int a, int b);
int min;
for(min= a;min <= a*b;min ++){
if(min % a == 0 && min % b ==0){
printf("BCLN cua %d va %d la : %d\n",a,b,min);
break;
case 3:
do{
printf("moi ban nhap vao gio bat dau : ");
scanf("%d",&gioBD);
printf("\nmoi ban nhap vao gio ket thuc : ");
scanf("%d",&gioKT);
}while(gioBD<=11 || gioKT>=24 || gioBD >= 24 || gioKT <= 11);
if(gioBD>=12 && gioKT <=23){
tonggio = gioKT - gioBD;
if(tonggio <= 3){
tien = tonggio * 150000;
}
else{
tien = (tonggio - 3)* 0.7 *150000;
if(gioBD==14 && gioKT == 17){
tien*= 0.9;
}
}
}
printf("\ntong so tien can thanh toan la : %d ",tien);
}
case 4:
printf("Xin moi nhap so tien dien:");
scanf("%d",&i);
if(i>0 && i<50){
tong_tien_dien = x*1678;
printf("tong tien dien %d",&tong_tien_dien);
}else if(i>=51 && i<100){
tong_tien_dien = 50*1678 + (i-50)*1734;
printf("tong tien dien %d",&tong_tien_dien);
}else if(i>=101 && i<200){
tong_tien_dien = 50*1678 + (i-50)*1734 + (i-100)*2014;
printf("tong tien dien %d",&tong_tien_dien);
}else if(i>=201 && i<300){
tong_tien_dien = 50*1678 + (i-50)*1734 + (i-100)*2014 + (i-100)*2536;
printf("tong tien dien %d",&tong_tien_dien);
}else if (i>=301 && i<400){
tong_tien_dien = 50*1678 + (i-50)*1734 + (i-100)*2014 + (i-100)*2536 + (i-100)*2834;
printf("tong tien dien %d",&tong_tien_dien);
}else if (i>=401){
tong_tien_dien = 50*1678 + (i-50)*1734 + (i-100)*2014 + (i-100)*2536 + (i-100)*2834 + (i-100)*2927;
printf("tong tien dien %d",&tong_tien_dien);
}
break;
case 5:
struct SinhVien dsSV[5];
int i;
for(i=0;i<5;i++){
printf("Xin moi nhap ho ten sinh vien thu: %d ",i+1);
gets(dsSV[i].hoTen);
printf("Nhap diem TB sv thu %d: ",i+1);
scanf("%f",&dsSV[i].diemTB);
getchar();
}
int j;
for(i=0;i<4;i++){
for(j=i+1;j<5;j++){
if(dsSV[i].diemTB<dsSV[j].diemTB){
float diemTam= dsSV[i].diemTB;
dsSV[i].diemTB=dsSV[j].diemTB;
dsSV[j].diemTB=diemTam;
char tenTam[50];
strcpy(tenTam,dsSV[i].hoTen);
strcpy(dsSV[i].hoTen,dsSV[j].hoTen);
strcpy(dsSV[j].hoTen,tenTam);
}
}
}
printf("\nDanh sach sinh vien! ");
for(i=0;i<5;i++){
printf("\nHo ten: %s",dsSV[i].hoTen);
printf("\nDiem TB: %.1f",dsSV[i].diemTB);
if(dsSV[i].diemTB>=9){
printf("\nHoc luc: xuat sac ");
}else if(dsSV[i].diemTB>=8){
printf("\n Hoc luc: Gioi ");
}else if(dsSV[i].diemTB>=6.5){
printf("\nHoc luc: Kha ");
}else if(dsSV[i].diemTB>=5){
printf("\nHoc luc: Trung binh ");
}else{
printf("\nHoc luc: Yeu ");
}
}
break;
case 6:
struct PhanSo so1,so2;
printf("Xin moi nhap vao phan so thu 1: ");
scanf("%d%d",&so1.tuSo,&so1.mauSo);
printf("Xin moi nhap vao phan so thu 2: ");
scanf("%d%d",&so2.tuSo,&so2.mauSo);
struct PhanSo tong,hieu,tich,thuong;
tich.tuSo = so1.tuSo * so2.tuSo;
tich.mauSo = so1.mauSo * so2.mauSo;
thuong.tuSo = so1.tuSo * so2.mauSo;
thuong.mauSo =so1.mauSo * so2.tuSo;
tong.mauSo = so1.mauSo * so2.mauSo;
tong.tuSo = so1.tuSo *so2.mauSo +so2.tuSo*so1.mauSo;
hieu.mauSo = so1.mauSo * so2.mauSo;
hieu.tuSo = so1.tuSo *so2.mauSo - so2.tuSo*so1.mauSo;
printf("Tong 2 phan so: %d/%d",tong.tuSo,tong.mauSo);
printf("Hieu 2 phan so: %d/%d",hieu.tuSo,hieu.mauSo);
printf("Tich 2 phan so: %d/%d",tich.tuSo,tich.mauSo);
printf("Thuong 2 phan so: %d/%d",thuong.tuSo,thuong.mauSo);
break;
default:
printf("Gia tri khong chinh xac vui long nhap lai: ");
}
}
}while(chon!=0);