本文介绍了完全对齐使用向量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试创建一个证明文件内容合理性的程序。到目前为止我的代码是这样的:

Hello, I am trying to create a program that justifies the contents of the file. so far my code is this:

#include <iostream>
#include <vector>
#include<string>
#include <fstream>
using namespace std;

int main()
{
int column=25;
vector<string>paragraph;
vector<string>words;
string str;

  ifstream fin("myFile.txt");

  do{
    str="";
    getline(fin,str);
    paragraph.push_back(str);
  }while(str!="");
fin.close();
words.push_back(paragraph.at(0));
for(int i=0;i<words.size();i++){

    str=words.at(i);

}

for(int i=0;i<column;i++){

    cout<<str.at(i);

    sum+=sum;



}



我把文件的所有内容在矢量段落中。和矢量字上的每一行。我要在每一行显示25个字符。这之后会有什么步骤?谢谢你的帮助


I put all the contents of the file in the vector paragraph. and each line on vector words. Ihave to display 25 characters on each line. what should be steps after this? Thank you for your help

推荐答案


这篇关于完全对齐使用向量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:23