Respuesta :

belali

#include <bits/stdc++.h>

typedef std::string s;

std::vector<int> m;

void mexp(s path) {

   std::fstream data(path);

   std::cout << "How many times do you want to multiply?: ";

   int i,k,c; std::cin>>i;

   while(!data.eof()) {

       data>>k;

       if(k==0) m.push_back(0);

       else m.push_back(pow(k,i));

   }

   

   //Print last matrix

   for(auto& pr:m) {

       std::cout << pr << " ";

       c++;

       if(c%3==0) std::cout << std::endl;

   }

}

int main(int argc, char* argv[]) {

   std::cout << "Enter a path: ";

   s p; std::cin>>p;

   mexp(p);

   return 0;

}

ACCESS MORE