右側折り返し(c++の場合)
#include <iostream> using namespace std; int main(void){ int num=0; char word; int maxlength=71; while(cin.get(word)){ if(word == '\n'){ num=0; }else if(num > maxlength){ cout << endl; num=0; }else{ num++; } cout << word; } return 0; }