Last asm...
int main(int argc, char *argv[]) {
int x,i,v,mkm1,mkm2;
int b=1000000;
int z=123456;
char r[10];
printf ("-------------------------------He thong ATM kich hoat.--------------------------");
printf ("\n-Xin chao :Nguyen Van A");
for(i=0;i<100;i++){
printf("\n-Xin moi nhap mat khau cua ban:");scanf("%d",&x);
printf(" ---Dang kiem tra thong tin---");
if(x==z){
printf("\n ---Chuc mung ban da dang nhap thanh cong---");
i=100; //Menu hinh chinh
for (i=1;i<100;i++){
printf("\n--------------------------Chao mung ban den voi he thong ATM .------------------");
printf("\n ||1.Kiem tra so du trong tai khoan. ||");
printf("\n ||2.Rut tien. ||");
printf("\n ||3.Chuyen khoan. ||");
printf("\n ||4.Doi mat khau. ||");
printf("\n ||0.Ket thuc giao dich. ||");
int a;
printf("\n#Chon:");scanf("%d",&a);
//ops 1:Kiem tra tk
if(a==1){
printf("-Ten chu tai khoan:Nguyen Van A");
printf("\n-So du trong tai khoan:%d(k VND)",b);
}
//ops 2:Rut tien
else if(a==2){
printf("-So du trong tai khoan cua ban la:%d (k VND)",b);
printf("\n-Nhap so tien ban muon rut:");scanf("%d",&v);
printf(".....Dang rut tien.....");
printf("\n.........Xong..........");
printf("\n-So du cua ban:%d(k VND)",b-v);
b=b-v;
}
//ops 3:Chuyen khoan
else if(a==3){
printf("\nSo tien trong tai khoan cua ban:%d (k VND)",b);
printf("\nNhap so tai khoan muon chuyen:");scanf("%d",&x);
printf("\nSo tien muon chuyen: "); scanf("%d", &v);
printf("\n......Dang chuyen.........");
printf("\n.........Xong.............");
printf("\nSo du trong tai khoan cua ban:%d (kVND)",b-v);
b=b-v;
}
//ops 4:Doi mat khau ca nhan
else if (a==4){
printf("Ban da lua chon doi mat khau...");
printf("Yeu cau nhap mat khau cu:");scanf("%d",&x);
if(x==z){
printf("Nhap mat khau moi:");scanf("%d",&mkm1);
printf("Nhap lai mat khau moi:");scanf("%d",&mkm2);
if (mkm2==mkm1){
printf("Doi mat khau thanh cong.");
z=mkm1;
}
else{
printf("Mat khau khong chinh xac");
}
}
}
//ops 0:Thoat chuong trinh
else if(a==0){
printf("--------------------------Chuc ban mot ngay tot lanh.--------------------------");
i=100;
}
}
}
else{
printf("Mat khau khong chinh xac.");
}
}
return 0;
}
No comments:
Post a Comment