آموزش ++C آموزش و سورس های برنامه نویسی به زبان ++C |
||||||||||||||||||||||||||||||||||||
یک شنبه 3 ارديبهشت 1391برچسب:, :: 17:27 :: نويسنده : کیوان مجنونی
برنامه ای که با گرفتن یک ماتریس، مثلثی بودن یا نبودن آن را حساب میکند.
#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< for(int i=0;i int row=1; while(row<=size) { cout<<"Enter numbers for row "< cin>>matrix[row-1][i]; } row++; } for(i=0;i for(int j=0;j cout< 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
نظرات شما عزیزان:
آخرین مطالب آرشيو وبلاگ پیوندهای روزانه پيوندها
![]() نويسندگان
|
||||||||||||||||||||||||||||||||||||
![]() |