#include<fstream>
#include<iostream>

using namespace std;

int main()
{
	ifstream in;
	int a[10];
	int j=0;
	in.open("data.txt",ios_base::in);   //你自己要先新建一个num.txt来放数字
	while(!in.eof())
	{
		in>>a[j];
		cout<<"a["<<j<<"]="<<a[j]<<endl;
		j++;
	}
	in.close();
	system("pause");
	return 0;
}


相关文章:

  • 2021-12-05
  • 2021-11-04
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
猜你喜欢
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案