// ファイルをテキスト読み込みモードで開く int fileID = open("world.txt", "r"); // ファイル行数を取得 int n = countln(fileID); for( int i=0; i