Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please convert this code in C++ Import random import time a = [] b = [] def thirty2(): for i in range(32): a.append([random.uniform(1, 10) for
please convert this code in C++ Import random import time a = [] b = [] def thirty2(): for i in range(32): a.append([random.uniform(1, 10) for x in range(1,33)]) for j in range(32): b.append([random.uniform(1, 10) for x in range(1, 33)]) soln = [[sum(x*y for x,y in zip(x_row,y_col)) for y_col in zip(*b)] for x_row in a] return soln a.clear() b.clear()
while True: print("-------------------------") print("Add N as 32, 64, 128, 256, or 512 ---- 0 to exit") x = int(input("Enter N: ")) if x == 32: starttime = time.process_time() print(thirty2()) print("") cpu_time = time.process_time() - starttime print ("System and CPU time : {:0.5f}s".format(cpu_time)) print("-------------------------") print("Thank you for taking part please rerun for another set") break
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started