diff --git a/inscode.nix b/inscode.nix index 0e31ac39b176de826a0b89c494739876f96eb2c0..13e84ca0add727830bf448b8a922864c5b2df581 100644 --- a/inscode.nix +++ b/inscode.nix @@ -1,6 +1,6 @@ -{ pkgs }: { - deps = [ - pkgs.python310Packages.pip - pkgs.python310Full - ]; -} \ No newline at end of file +h_data= input("请输入十六进制数: "); +print("十六进制数为:",h_data); +data = int(h_data,16); +print("对应二进制数是:",data); +b_data = bin(data); +print("对应二进制数是:",b_data); \ No newline at end of file diff --git a/main.py b/main.py index 4c0c135f61696bcf42c375ca5ab62aa5b105afc8..13e84ca0add727830bf448b8a922864c5b2df581 100644 --- a/main.py +++ b/main.py @@ -1 +1,6 @@ -print('欢迎来到 InsCode') \ No newline at end of file +h_data= input("请输入十六进制数: "); +print("十六进制数为:",h_data); +data = int(h_data,16); +print("对应二进制数是:",data); +b_data = bin(data); +print("对应二进制数是:",b_data); \ No newline at end of file