右側折り返し(cの場合)
#include <stdio.h> int main(void){ int num=0; char word; FILE *stream; int maxlength=71; stream = fopen("../data_c.txt","r"); while((word = getc(stream)) != EOF){ if(word == '\n'){ num=0; }else if(num > maxlength){ printf("\n"); num=0; }else{ num++; } printf("%c",word); } return 0; }