Package: pchjlib
Cac ham kiem tra tinh chat so nguyen to va so nguyen to lien quan:Ham kiem tra xem mot so co phai la so nguyen to hay khong.-kiem_tra_so_nguyen_to(n).>>True/Falseneu(khong)lasonguyento;Ham tao danh sach cac so nguyen to den n.-tao_danh_sach_so_nguyen_to(n).>>Motdanhsachcacsonguyentonamtrongkhoangtu0toisondanhap;Ham kiem tra so emirp (mot so emirp la mot so nguyen to ma khi dao nguoc vi tri cac chu so cua no, ta cung duoc mot so nguyen to, khong ke nhung so nguyen to doi xung).-kiem_tra_so_emirp(n).>>True/Falseneu(khong)lasoemirp;Ham tao so emirp den n.-tao_danh_sach_so_emirp(n).>>Motdanhsachcacsoemirpnamtrongkhoangtu0toisondanhap;Cac ham lien quan den so Fibonacci:Ham tinh so Fibonacci thu n.-vi_tri_so_Fibonacci(n).>>VitricuamotsoFibonaccithun;Ham tao danh sach cac so Fibonacci den n.-tao_danh_sach_so_Fibonacci(n).>>MotdanhsachcacsoFibonaccitrongkhoangtu0toisondanhap;Cac ham so hoan thien, so tu man, hua hon, hoan hao, than thiet va tinh tong cac uoc, chu so:Ham tinh tong cac uoc so cua n khong tinh n va khong am.-tong_uoc_so(n).>>Tongcacuocsoduongcuason;Ham tinh tong cac chu so cua mot so.-tong_chu_so(n).>>Tongcacchusocuason;Ham kiem tra xem mot so co phai la so hoan thien (mot so hoan thien la mot so nguyen duong ma tong cac uoc nguyen duong cua no bang chinh no).-kiem_tra_so_hoan_thien(n).>>True/Falseneu(khong)lasohoanthien;Ham tao danh sach cac so hoan thien.-tao_danh_sach_so_hoan_thien(n).>>Motdanhsachcacsohoanthientrongkhoangtu0toisondanhap;Ham kiem tra so tu man (mot so tu man la so bang tong cac mu bac ba cua moi chu so cua no).-kiem_tra_so_tu_man(n).>>True/Falseneu(khong)lamotsotuman;Ham tao danh sach cac so tu man.-tao_danh_sach_so_tu_man(n).>>Motdanhsachcacsotumantrongkhoangtu0toisondanhap;Ham kiem tra cap so hua hon (mot cap so hua hon la hai so nguyen duong ma tong cac uoc cua so nay (khong tinh so do) nhieu hon so kia dung 1 don vi).-cap_so_hua_hon(a,b).>>True/Falseneua,b(khong)lamotcapsohuahon.Ham kiem tra so hoan hao (mot so hoan hao la khi tong cac uoc so thuc su cua n cung bang n).-kiem_tra_so_hoan_hao(n).>>True/Falseneu(khong)lamotsohoanhao;Ham tao danh sach so hoan hao.-tao_danh_sach_so_hoan_hao(n).>>Motdanhsachcacsohoanhaotrongkhoangtu0toisondanhap;Cac ham kiem tra va tao danh sach so chinh phuong, than thiet, manh me loai 1, 2:Ham kiem tra so chinh phuong (so chinh phuong la so ma neu no la binh phuong cua mot so nguyen).-kiem_tra_so_chinh_phuong(n).>>True/Falseneu(khong)lamotsochinhphuong;Ham tao danh sach cac so chinh phuong den n.-tao_danh_sach_so_chinh_phuong(n).>>Motdanhsachcacsochinhphuongtrongkhoangtu0toisondanhap;Ham kiem tra xem hai so co phai la cac so than thiet (mot cap so than thiet la khi chung tuan theo quy luat: So nay bang tong tat ca cac uoc cua so kia (tru chinh so do) va nguoc lai).-cap_so_than_thiet(a,b).>>True/Falseneua,b(khong)lacacsothanthiet;Ham kiem tra so manh me (neu tong chu so no la mot so nguyen to).-kiem_tra_so_manh_me_1(n).>>True/Falseneu(khong)lamotsomanhme;Ham kiem tra so manh me (neu mot so vua chia het cho nhung so nguyen to va binh phuong cua chung truoc no).-kiem_tra_so_manh_me_2(n).>>True/Falseneu(khong)lamotsomanhme;Cac ham lien quan den uoc so va boi so:Ham tao danh sach cac uoc so cua mot so.-tao_danh_sach_uoc_so(n).>>Motdanhsachcacuocsocuamotso;Ham tim uoc chung lon nhat cua 2 so.-uoc_chung_lon_nhat(a,b).>>Giatriuocchunglonnhatcuaa,b;Ham tinh uoc so chung lon cua mot danh sach cac so (uoc chung lon nhat cua nhieu so).-uoc_chung_lon_nhat_cua_danh_sach(array).>>Giatriuocchunglonnhatcuaarray;Ham tinh boi so chung nho nhat cua hai so.-boi_chung_nho_nhat(a,b).>>Giatriboichungnhonhatcuaa,b;Ham tinh boi so chung nho nhat cua mot danh sach cac so (boi chung nho nhat cua nhieu so).-boi_chung_nho_nhat_cua_danh_sach(array).>>Giatriboichungnhonhatcuaarray;Ham tao danh sach cac boi so cua mot so len den 10 lan.-tao_danh_sach_boi_so(n).>>Motdanhsachcacsoboisocuatu0toi10lan;Ham tao gia tri cac uoc chung cua mot danh sach.-uoc_chung_cua_danh_sach(arr).>>Motdanhsachcacuocchungcuadanhsach.Cac ham lien quan den tinh chat so song to va so phong phu:Ham kiem tra cac so song to.-kiem_tra_so_song_to(n).>>True/Falseneu(khong)lamotsosongto;Ham tao danh sach cac so song to.-tao_danh_sach_so_song_to(n).>>Motdanhsachcacsosongtotu0toin;Ham kiem tra cac so phong phu. (So tu nhien N duoc goi la so phong phu neu tong cac uoc cua N (khong ke N) lon hon N).-kiem_tra_so_phong_phu(number).>>True/Falseneu(khong)lamotsophongphu;Ham tao danh sach cac so phong phu.-tao_danh_sach_so_phong_phu(n).>>Motdanhsachcacsophongphutu0toin;Cac ham lien quan den phan tich thua so nguyen to:Ham tinh cac thua so nguyen to cua mot so (vip).-thua_so_nguyen_to_day_du(n).>>Travetichcuanhungsonguyento(cosomu)bangson;Ham tinh cac thua so nguyen to cua mot so dang list.-thua_so_nguyen_to(n).>>Travemotdanhsachcacsonguyentocotichbangn;Ham tinh uoc so chung lon nhat nguyen to cua hai so.-uoc_chung_nguyen_to_2_so(a,b).>>Giatriuocchungnguyentolonnhatcuaa,b;Cac ham lien quan den phuong trinh va bieu thuc toan hoc:Ham giai phuong trinh bac 1, 2 mot an va vai luu y, khi nhap: phuong_trinh = "12x^2 + 34 - 24 = 23x - 13".-giai_pt_bac_1va2_dang_string(phuong_trinh).>>Nghiemcuaphuongtrinh;Ham giai phuong trinh bac 1 - 10 bang cach nhap he so.(bac = bac cua phuong trinh).-giai_phuong_trinh(bac,he_so_phuong_trinh):>>Nghiemcuaphuongtrinh;Cac ham lien quan den trich xuat, xu ly chuoi, danh sach:Ham loai bo cac phan tu trung lap tu mot danh sach.-danh_sach_khong_trung_lap(lst).>>Danhsachvoinhungphantukhongtrunglap;Ham trich xuat cac chu so tu mot chuoi.-trich_xuat_chu_so_tu_chuoi(s).>>Motchuoichusocotrongs;Ham trich xuat cac so tu mot chuoi.-trich_xuat_so_tu_chuoi(s).>>Motchuoicacsocotrongs;Ham trich xuat cac ky tu tu mot chuoi.-trich_xuat_ki_tu(s).>>Trichxuatkitucotrongs;Ham an ki tu dang "322/212/202332" == "ooo/ooo/oooooo".-an_ki_tu(s).>>Motdaykituanmakhongthetruylaisbandau;Ham trich xuat cac so tu chuoi so. VD: "32/232343244" se la "32.232343244".-trich_xuat_cac_so_tu_so(s).>>Trichxuatcacsotumotdaysonhunglanvoikitu;Ham nen xau loai 1. VD: "google" se la "2ol2ge".-xau_duoc_nen_1(s).>>Xauduocnen;Ham nen xau loai 2. VD: "google" se la "g2ogle".-xau_duoc_nen_2(s).>>Xauduocnen;Ham nen xau nhung khong ghi so. VD: "hhhooccsiinh" se la "hocsinh".-xau_duoc_nen_khong_so(chuoi_nhap).>>Xauduocnen;Ham giai nen xau. VD: "3ab3c" se la "aaabccc"-xau_duoc_giai_nen(s).>>Xauduocgiainen;Ham tao ra xau ki tu khong trung lap. VD: "Google" se la "gole".-xau_ki_tu_khong_trung_lap(s).>>Xaukitukhongtrunglap;Mat ma Caesar:Phuong phap ma hoa cua Caesar duoc vi du cu the nhu sau:-DungmatmacuaCaesarchuyenbucthu"MEET YOU IN THE PARK"thanhbucthubimat.-Cacchucaiduocbieudienthanhsotheoquytacsau.>>ABCDEFGHIJKLMNOPQRSTUVWXYZ>>012345678910111213141516171819202122232425-Khidobucthugoc"MEET YOU IN THE PARK"trothanh(khongtinhkhoangtrang):"12 4 4 19 24 14 20 8 13 19 7 4 15 0 17 10"-Baygiotasequaychuoiso0->25sangtraikso(vidutrongtruonghopnayk=3)khidotacobangsau.>>012345678910111213141516171819202122232425>>345678910111213141516171819202122232425012-Khidochuoiso"12 4 4 19 24 14 20 8 13 19 7 4 15 0 17 10"seduocmahoathanh:"15 7 7 22 1 17 23 11 16 22 10 7 18 3 20 13"Ham chuyen hoa chuoi thanh mat ma Caesar.-chuyen_hoa_caesar(string,sang_trai_k_so).>>Daysomatmacaesar;Ham ma hoa day so Caesar.-ma_hoa_caesar(array,sang_trai_k_so).>>Xauduocmahoaboidaysomatma;Cac ham mo phong chi voi string:Ham mo phong qua trinh "Tai xuong" (pham vi so n la lon hon 0 va nho hon 88).-mp_tai_xuong(n):Dangtaixuong[â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–]100%Taixuonghoantat!Ham mo phong qua trinh "tinh toan" cua "Admin" (giong nhu mo phong tai xuong).-mp_tinh_toan(n):AD:Dangtinhtoan[â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–]100%Ham mo phong qua trinh "LOADING...".-mp_loading(n):>>LOADING...Ham mo phong cay thong.-mp_christmas_tree():****************************************************Ham ho tro tinh toan dac biet:Ham tinh toan cac cong thuc vat ly.-tinh_toan_vat_ly_8().>>Motbangluachoncaccongthucvatly8chuongtrinhGDPT2018sachCTSTHK1;>>â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”|>>>>>NHAPTENCONGTHUCBANMUONDEADMINTINH<<<<<||~~~!Luuy:Nhaptheoyeucau!~~~||||-->1.Congthuctinh:Khoiluongrieng(kihieuD,Kg/m^3)||-->2.Congthuctinh:Trongluongrieng(kihieud,donviN/m^3)||-->3.Congthuctinh:LucdayArchimedes(kihieuFa,donviN)||-->4.Congthuctinh:Trongluong(kihieuP,donviN)||-->5.Congthuctinh:Apsuatchatran(kihieup,N/m^2)||-->6.Congthuctinh:Apsuatchatlong(kihieup,N/m^2)|â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”â€”-AD:NhapcongthucbanchondeADtinh:4-Nhapkhoiluongcuavat(kg):3.4AD:Dangtinhtoan[â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–â–]100%AD:Trongluongcuachatdola:33.32NHam tinh toan tien dien a la chi so cu, b la chi so moi (b > a).-tinh_toan_tien_dien(chi_so_cu,chi_so_moi).>>SoKwhdatieuthuvasotienphaitra;Ham tim mot so lon nhat co tong cac chu "a" so bang so "b". VD: 3, 21 se bang 993.-tong_chu_so_lon_nhat_bang_n(number_of_digits,int_number).>>Soketqua;Ham dinh ly Pythagore (muon tim canh nao thi cho canh do bang False. VD a = 1, b = 2, c = False de tim c va trong do, a la canh goc vuong 1, b la canh goc vuong 2, c la canh huyen).-pythagore(a,b,c).>>Giatricuacanhcantimtrongtamgiac;Quy luat:Ham tao danh sach cac so theo quy luat: 1 so chia het 1, 2 so chia het 2, 3 so chia het 3, ... cho toi tong so luong la number.-tao_danh_sach_quy_luat_1(number).>>Motdanhsachtheoquyluat1;Ham tao mot day so theo quy luat: cap so nhan voi n phan tu va m. VD: n = 10, m = 2 -> array = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18].-tao_danh_sach_quy_luat_2(m,n).>>Motdanhsachtheoquyluat2;Ham tao day so theo quy luat: so mu nang toi lan thu n cua so m. VD: m = 3, n = 10 -> array = [3^0, 3^1, 3^2, ... , 3^10].-tao_danh_sach_quy_luat_3(n,m).>>Motdanhsachtheoquyluat3;Khac:Ham chuyen doi so binh thuong thanh so La Ma.-chuyen_doi_so_la_ma(num).>>Solamacuanum;Ham dem so nghich the trong mot danh sach (cho day so nguyen duong gom n phan tu a1, a2 ,â€¦, a{n} . Mot cap (a[i], a[j] ) duoc goi la mot nghich the neu i < j va a[i] > a[j]).-dem_so_nghich_the(danh_sach).>>Songhichthetrongdanhsach;Ham choi keo bua bao voi "A.I".-one_two_three().>>NhungsuluachondebanchoikeobuabaovoiA.I;NHUNG BAN CAP NHAT0.0.3.4 - (26/02/2024).Bo sung "ham uoc_chung_cua_danh_sach" (de tim cac uoc chung trong mot array).0.0.3.3 - (21/02/2024).Nang cap info library, README.0.0.3.2 - (20/02/2024).Bo sung so phong phu.0.0.3.1 - (20/02/2024).Nang cap info library.0.0.3 - (20/02/2024).Bo sung "xau_ki_tu_khong_trung_lap" (khong theo thu tu bang chu cai) va loai bo "ki_tu_trung_lap" (theo thu tu bang chu cai).0.0.2.10 - (19/02/2024).Nang cap README.0.0.2.9 - (19/02/2024).Thu nghiem.0.0.2.8 - (19/02/2024).Thu nghiem.0.0.2.7 - (18/02/2024).Nang cap README.0.0.2.6 - (18/02/2024).Thay doi sang MIT License.0.0.2.5 - (18/02/2024).Nang cap README.0.0.2.4 - (18/02/2024).Nang cap README.0.0.2.3 - (18/02/2024).Thu nghiem.0.0.2.2 - (14/02/2024).Thu nghiem.0.0.2.1 - (14/02/2024).Thu nghiem.0.0.2 - (14/02/2024).Sua loi khong them cac phu thuoc.0.0.1.2 - (14/02/2024).Thu nghiem.0.0.1.1 - (14/2/2024).Thu nghiem.0.0.1 - (14/02/2024).Phien ban dau tien.0.0.0.1 - (14/02/2024).Thu nghiem.