You are viewing a single comment's thread. Return to all comments →
Simple code for c++14
#include <iostream> #include <algorithm> using namespace std; int main() { string s; unsigned long int n; cin >> s; cin >> n; cout << ( //string length * a's count + rest of the string a's cut ((n/s.size()) * count(s.begin(),s.end(),'a')) + count(s.begin(),s.begin() + n%s.size(),'a') ); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Repeated String
You are viewing a single comment's thread. Return to all comments →
Simple code for c++14