123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
#include<iostream> #include<fstream> #include<string> int _tmain(int argc, _TCHAR* argv[]) { std::fstream file; std::string temp; double first,second,third; file.open("rm.txt"); /* while(file.good()) { std::getline(file,temp); std::cout<<temp<<std::endl; } */ while(file.good()) { std::getline(file,temp); std::getline(file,temp); std::getline(file,temp); file>>temp; file>>temp; file>>temp; file>>temp; file>>first; file>>temp; file>>temp; file>>temp; file>>temp; file>>temp; file>>second; file>>temp; file>>temp; file>>temp; file>>temp; file>>temp; file>>third; std::getline(file,temp); std::cout<<"Diagonals are : "<<first<<" "<<second<<" "<<third<<std::endl; } file.close(); system("PAUSE"); return 0; }
int main(int argc, char *argv[])