Viết bởi AnhSaoDem » Hai T7 28, 2008 11:24 pm
Xin loi vi minh dung mac nen khong go duoc Tieng Viet, moi nguoi chiu kho dich tam vay.
Neu nhu bieu dien nhi phan cua 1 so duoc sinh ra duoi dang cau truc (1(01*0)*10*)* thi no se chia het cho 3.
Trong do "*" bieu thi chu so hoac bieu thuc trong ngoac dung truoc no duoc lap lai lien tiep n lan, voi n la so nguyen khong am.
vi du
1(00)1 =1001,
1(0(1)0)1 = 10101,
1(0(11)0) =10110,
101010101010000
....
de kiem tra xem bieu dien nhi phan cua 1 so co dang cau truc tren hay khong, co the viet 1 chuong trinh de quy bang C, Java...
Tuy nhien co 1 cach don gian hon khi viet chuong trinh loai nay, do la su dung bo phan tich cu phap YACC. Vi dang ban thi hoc ky nen khong co thoi gian viet cu the ve cai nay, ban tu tim hieu them YACC tren cac trang web nhe!
Xin loi vi minh dung mac nen khong go duoc Tieng Viet, moi nguoi chiu kho dich tam vay.
Neu nhu bieu dien nhi phan cua 1 so duoc sinh ra duoi dang cau truc (1(01*0)*10*)* thi no se chia het cho 3.
Trong do "*" bieu thi chu so hoac bieu thuc trong ngoac dung truoc no duoc lap lai lien tiep n lan, voi n la so nguyen khong am.
vi du
1(00)1 =1001,
1(0(1)0)1 = 10101,
1(0(11)0) =10110,
101010101010000
....
de kiem tra xem bieu dien nhi phan cua 1 so co dang cau truc tren hay khong, co the viet 1 chuong trinh de quy bang C, Java...
Tuy nhien co 1 cach don gian hon khi viet chuong trinh loai nay, do la su dung bo phan tich cu phap YACC. Vi dang ban thi hoc ky nen khong co thoi gian viet cu the ve cai nay, ban tu tim hieu them YACC tren cac trang web nhe!