include iostream include string using namespace std int main int strin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include <iostream>
#include <string>
using namespace std;
int main() {
int n,x,i=0,k=0;
string a;
getline(cin,a);
cin >> n;
for(int i=0;i<a.size()/n;i++){
cout << a.substr(i*n,n) << endl;
}
cout << a.substr(a.size()-a.size()%n,a.size()%n);
}