Есть ответ 👍

На с++ дан файл. удалить из него третью строку. результат записать в другой файл.

272
482
Посмотреть ответы 2

Ответы на вопрос:


#include < iostream> #include < fstream> #include < string> #include < vector> #include < iterator> using namespace std;   int main() {      vector< string> str;       string text;       ifstream fin("a.txt");       while (getline(fin, text)) {          str.push_back(text);       }      fin.close();       str.erase(str.begin() + 2);       ofstream fout("b.txt");       copy(str. str. ostream_iterator< string> (fout, "\n"));       fout.close();       system("pause");       return 0; }

P= 25,8*500кг = 129000

Популярно: Информатика