User
Pass
2FA
 
 

matrici c++

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash -> Homework zone
Author Message1468
MadalinXd

[Mentally Stable]



Status: Offline
(since 03-09-2023 11:57)
Joined: 02 Dec 2013
Posts: 227, Topics: 25
Location: Romania

Reputation: 134.4
Votes: 33

Post Posted: 20-10-2014, 16:30:00 | Translate post to: ... (Click for more languages)

As dori si eu cateva idei cum sa rezolv aceasta problema cu matrici.

1.Sa se afiseze simetrica matricei fata de axa verticala care trece prin centrul matricei.

Code:

1 2 3 4 5
6 7 8 9 10


Eu am incercat cu aceasta varianta dar nu functioneaza:
Code:

      for(int i=1;i<=n;i++)
        {
            for(int j=1;j<=m;j++)
            {
               if(j<(m+1)/2)
               {
                   aux=v[i][j];
                   v[i][j]=v[i][m-i+1];
                   v[i][m-i+1]=aux;
               }
            }
     }

i=linia
j=coloana
n=nr de linii
j=nr de coloane;



Nu vreau mura in gura doar o idee cum sa-l fac de unde sa incep.

0 0
  
Back to top
View user's profile Send private message
tudor1297

[shefu' la luptatori]



Status: Offline
(since 01-02-2020 14:06)
Joined: 11 Sep 2012
Posts: 2565, Topics: 193
Location: Bucuresti

Reputation: 363.9
Votes: 250

         
Post Posted: 20-10-2014, 16:45:20 | Translate post to: ... (Click for more languages)

stai putin ca nu inteleg
pentru exemplu ala ar trebui sa afisezi asa?

5 4 3 2 1
10 9 8 7 6


banuiesc ca asta tre sa faci


dar vezi ca nu trebuie neaparat sa modifici matricea. adica ai putea pur si simplu sa o afisezi, numai ca in alta ordine.
poti face asta asa:

Quote:


for(i=1;i<=n;++i)
for(j=m;j>=1;--j)
cout<< v[i][j];




anyway, nici ideea ta nu e gresita, doar ca faci niste operatii inutile -

greseala ta e ca ai pus v[i][m-i+1] in loc de v[i][m-j+1]
din cauza asta nu-ti merge programul




[RO]Warrior Fury PvE Guide 5.4.8

[EN]Warrior Fury PvE Guide 5.4.8



Last edited by tudor1297 on 20-10-2014, 16:55:07; edited 1 time in total
0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
MadalinXd

[Mentally Stable]



Status: Offline
(since 03-09-2023 11:57)
Joined: 02 Dec 2013
Posts: 227, Topics: 25
Location: Romania

Reputation: 134.4
Votes: 33

Post Posted: 20-10-2014, 16:52:27 | Translate post to: ... (Click for more languages)

Da.
T/C am rezolvat.

0 0
  
Back to top
View user's profile Send private message
tudor1297

[shefu' la luptatori]



Status: Offline
(since 01-02-2020 14:06)
Joined: 11 Sep 2012
Posts: 2565, Topics: 193
Location: Bucuresti

Reputation: 363.9
Votes: 250

         
Post Posted: 20-10-2014, 16:56:19 | Translate post to: ... (Click for more languages)

ah
am editat postul, dar fix inainte sa dau send am resetat pagina din greseala si-a trebuit sa scriu iar -




[RO]Warrior Fury PvE Guide 5.4.8

[EN]Warrior Fury PvE Guide 5.4.8

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
R3dBuLL
[Banned user]


Banned


Status: Offline
(since 17-12-2018 22:08)
Joined: 28 Mar 2014
Posts: 5334, Topics: 554
Location: Romania

Reputation: 257.8
Votes: 364

     
Post Posted: 11-01-2015, 18:28:18 | Translate post to: ... (Click for more languages)

@meeeeeow dai TC daca poti -


0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by PsychoLove, 25 January 2015 20:01



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash -> Homework zone  


The time now is 29-03-2024, 08:30:05
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x