it have txt format like:
12 12 12 12 12
3 3 3 3 3
12 12 12 12 12
23 23 23 23 23
I use this code to read 1st line how can read other line with line number/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
int a,b,c,d,e;
ifstream myfile("A.in");
myfile>>a>>b>>c>>d>>e;
cout<<a+b+c;
system("pause");
return 0;
}


Sign In
Create Account


Back to top










