lundi 25 avril 2022

Multiplying two big numbers represented as vectors C++ [closed]

I've created two vectors, in which we can generate as long integers as we want. I've already found a way to add and subtract them but I don't have a clue how to multiply them, for example:

vector<int>vec1{2,3,4,5,6,7,8,9,3,2,1,5}, vec2{1,2,3,4};             
vecotr<int>result{};'

I know that I should use long multiplication but I don't know how to start. The result should be: 289456780227310.

Aucun commentaire:

Enregistrer un commentaire