RYAN 发表于 2022-6-5 12:24:54

一个DOS模拟器

[ 本帖最后由 RYAN 于 2022-6-5 12:26 编辑 ]\n\nimport time
c = ['POS' , '附件']
fj = ['Calculator' , 'dog zero calculation' , 'Judge Leap Year']
print('Welcome to this operating system')
time.sleep(4)
print('Appendices:Calculator, dog zero calculation, Judge Leap Year')
while 1:
    ram = input('>>>')
    if ram == fj:
      a = input('Enter A to power, enter B to close the calculator, enter C to multiply:')
      if a != 'A' and a != 'C' and a != 'B':
            print('TAT\n Invalid input \nTAT')
      elif a == 'A' :
            a = float(input('Please enter the first number:'))
            b = float(input('Please enter the second number:'))
            c = a**b
            c = str(c)
            print('Equal to'+c)
      elif a == 'C' :
            a = float(input('Please enter the first number:'))
            b = float(input('Please enter the second number:'))
            print('Equal to' , a*b)
      else:
            print('out')
            break
    elif ram == fj:
      j = int(input('How old is the dog:'))
      if j <= 0 :
            print('That’s not possible')
      elif j == 1 :
            print('The equivalent of 14 years old')
      elif j == 2 :
            print('The equivalent of 22 years old')
      else:
            h = (j+22)*2
            print('The equivalent of' , h , 'years old')
    elif ram == fj:
      n = int(input('Please enter a year:'))
      if n % 4 == 0 and n % 100 != 0 or n % 400 == 0:
            print('{0}year, is a leap year.'.format(n))
      else:
            print('{0}year, not leap year.'.format(n))
    else:
      print('Invalid input')

RYAN 发表于 2022-6-5 12:27:03

快来看,快来看,快来看!

D22heqisa5yC 发表于 2022-6-12 12:54:16

yyds,666
快来看,快来看,快来看
页: [1]
查看完整版本: 一个DOS模拟器