ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

كمك، ماتريس، C، فوري!!!!

 
Post new topic   Reply to topic    ParsX.com Forum Index -> اصول ساختمان داده ها
View previous topic :: View next topic  
Author Message
only4u-m
مهمون يكي دو روزه


Joined: 05 Oct 2008
Posts: 5

PostPosted: Sun Oct 05, 2008 7:45 pm    Post subject: كمك، ماتريس، C، فوري!!!! Reply with quote

با سلام

من يك برنامه مي خوام كه تشخيص بده ماتريس قطري ه، بالا مثلثي ه، پايين مثلثي ه...

خودم تا يه جاهايي رفتم ولي تو قسمت if مشكل دارم، خواهش مي كنم كمكم كنيد Crying or Very sad

خواهش ميكنم هرچي زودتر، بهتر Sad

فقط تو C باشه لطفا...
Back to top
only4u-m
مهمون يكي دو روزه


Joined: 05 Oct 2008
Posts: 5

PostPosted: Sun Oct 05, 2008 8:39 pm    Post subject: تو رو خدا كمك كنيد Reply with quote

من به استادمون قول دادم اين برنامه رو بنويسم

#include <stdio.h>
#include <conio.h>
int main()
{
  clrscr();
  int i,j,mat[3][3];
  for(i=0;i<3;i++)
   for(j=0;j<3;j++)
    {
    printf("enter mat[%d][%d]:",i,j);
    scanf("%d",&mat[i][j]);
    }
    for(i=0;i<3;i++)
     {
     for(j=0;j<3;j++)
      printf("%5d",mat[i][j]);
     printf("\n");
     }
     getch();
     return 0;
     }

تا اينجا رفتم....، if رو نمي دونم........ :cry:  :cry:
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Mon Oct 06, 2008 8:37 am    Post subject: Reply with quote

کاری نداره برای بالا مثلثی حلقه دومت رو اینطوری کن :

for(j=i;j<3;j++)
      printf("%5d",mat[i][j]);

انشالله تعریف بالامثلثی و پایین مثلثی رو هم می دونی .
Back to top
only4u-m
مهمون يكي دو روزه


Joined: 05 Oct 2008
Posts: 5

PostPosted: Tue Oct 07, 2008 9:21 pm    Post subject: Reply with quote

مي شه بيشتر توضيح بديد، مبتدي هستم ديگه...
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Wed Oct 08, 2008 8:44 am    Post subject: Reply with quote

ماتریسی که تمام درایه های زیر قطر اصلی آن صفر باشد بالامثلثی هست و تمام درایه هایی که بالای قطر اصلی صفر باشد پایین مثلثی نام دارد .
http://drc.eaedu.net/anjoman/viewtopic.php?t=68

http://sstarsprograms.blogfa.com/post-89.aspx[/img]
Back to top
only4u-m
مهمون يكي دو روزه


Joined: 05 Oct 2008
Posts: 5

PostPosted: Thu Oct 09, 2008 1:47 pm    Post subject: تشكر Reply with quote

خيلي ممنون Laughing

راستش اون وبلاگ دومي رو رفته بودم و برنامه اش رو هم دانلود كرده بودم، ولي موقع اجرا ارور مي ده، اما خروجيش كار مي كنه، باز هم خيلي ممنون از راهنمايي شما... Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> اصول ساختمان داده ها All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum