C++读取多行多列txt简单示例代码

    技术2025-08-15  10

    #include<fstream> #include<iostream> int main(void) { std::ifstream infile; int a, b, c; infile.open("temp.txt"); if (infile) { while (!infile.eof()) { infile >> a >> b >> c; //多行三列 std::cout << a << b << c << std::endl; } } infile.close(); return 0; }
    Processed: 0.010, SQL: 9