0

Hello, I need your help. Please how to convert vector a1 to 2d vector a4?

https://code.sololearn.com/cu0DGUXKPzQc/?ref=app

3rd Jun 2022, 5:48 AM
TeaserCode
8 odpowiedzi
+ 1
If you run the code you can see what is expected to get. <a1> is vector with rearraged elements from vector <a>. Now I would like to get 2d vector <a4> with elements of vector <a1>. This vector <a4> should have 10 rows and 3 columns.
3rd Jun 2022, 7:49 AM
TeaserCode
+ 1
Ok I added a block using nested for...loop copying data from <a1> to <a4>.
4th Jun 2022, 4:01 AM
Ipang
+ 1
Amazing, thank you.
4th Jun 2022, 7:03 AM
TeaserCode
0
Can you show me a data example for <a1>, and how <a4> should look like after the conversion?
3rd Jun 2022, 6:18 AM
Ipang
0
Is there any simplier way with for loops?
3rd Jun 2022, 3:52 PM
TeaserCode
0
Are you not allowed to use built-in algorithm functions?
4th Jun 2022, 12:55 AM
Ipang
0
Your solution is correct, but I haven't learned the iterators yet.
4th Jun 2022, 3:11 AM
TeaserCode