C ++: ingrese un lote de enteros desde el teclado (con -1 como entrada final) y guárdelo en el archivo de texto xxxk1.txt

#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
void main ()
{
ofstream fout ("xxxk1.txt");
if (! fout)
{
cout << "文件 没有 打开!" << endl;
salida (1);
}
int x;
cin >> x;
while (x! = - 1)
{

fout << x << "";
cin >> x;
}
fout.close ();
}

Supongo que te gusta

Origin www.cnblogs.com/zhongxiaozheng/p/12757831.html
Recomendado
Clasificación