انجمن برنامه نویسان
.:: Your Adversing Here ::.

تعیین مثلثی بودن ماتریس

  • چهار شنبه 5 بهمن 1390برچسب:,
  • <-PostCategory->

include
#include

int Matrix(int** matrix,int size)
{
int down=0,up=0;
for(int i=0;i {
for(int j=0;j {
if(j>i && matrix[i][j] != 0)
down=2;
if(i>j && matrix[i][j] != 0)
up=1;
}
}
return down+up;
}

int main()
{
int size=0;
cout<<"Enter size of matrix(number of rows and columns):";
cin>>size;
cout< int **matrix=new int*[size];
for(int i=0;i matrix[i]=new int[size];
int row=1;
while(row<=size)
{
cout<<"Enter numbers for row "< for(int i=0;i {
cin>>matrix[row-1][i];
}
row++;
}
for(i=0;i {
for(int j=0;j cout< cout< }
cout< int ud=Matrix(matrix,size);
if(ud==3)
{
cout<<"Hich kodum"< }
else if(ud==2)
{
cout<<"Bala mosallasi"< }
else if(ud==1)
{
cout<<"Paein mosallasi"< }
else if(ud==0)
{
cout<<"Har do"< }
cout<<"Press any key to quit...";
getch();
return 0;
}


//end
 


نظرات شما عزیزان:

نام :
آدرس ایمیل:
وب سایت/بلاگ :
متن پیام:
:) :( ;) :D
;)) :X :? :P
:* =(( :O };-
:B /:) =DD :S
-) :-(( :-| :-))
نظر خصوصی

 کد را وارد نمایید:

 

 

 

عکس شما

آپلود عکس دلخواه:





مشاهده ادامه مطلب تعیین مثلثی بودن ماتریس