Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char s[256];
- int m, c;
- c = 0;
- cin >> m;
- cin >> s;
- while(1){
- if ( c + strlen(s) < m ){
- cout << s << ' ';
- c = c + 1 + strlen(s);
- }else{
- cout << endl << s;
- c = strlen(s);
- }
- cin >> s;
- if(s[0] == '\0')
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement