|
야래는 제가 짠 프로그램이구요 매트릭스 구하는 프로그램입니다
아웃풋이 a(0,0)= , a(1,0)= ,,,,,
a(1,0)=, a(1,1),....
.....
a(4,4)=
까지 구하는 문제인데요 아무리 해도 구할수가 없습니다 어떤때는 텍스트 파일이 아예 열리질 않고 어떤땐
매트릭스가 제대루 안구해지고요 도와주세요
#include <iostream>
#include<fstream> //required for ifstream, ofstream
#include <iomanip>
using namespace std;
int main(){
//define file streams for output
ofstream fout;
string filename;
cout<<"input the file name: ";
cin>>filename;
fout.open(filename.c_str(), ios::app);
if (fout.fail()){//check for errors
cout<<"Could not open output file "<<endl;
exit(1);//return error value 1 to system
}
int i=0;
int j=0;
while (i<5){
i++;
while(j<5){
j++;
}
}
fout<<"A("< |