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 -> Programming / Scripting / Database
Author Message1743
In2ition

[Globul de cristal]



Status: Offline
(since 30-04-2018 18:33)
Joined: 28 Aug 2006
Posts: 11769, Topics: 315
Location: Galati

Reputation: 1842.7
Votes: 199

Post Posted: 21-01-2012, 21:44:54 | Translate post to: ... (Click for more languages)

Textul problemei suna gen suma/produsul elementelor din figurile hasurate.




fig. 4
int sumaddp() // suma de deasupra diag. principale
{
int s=0;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(i<j)
s=s+a[i][j];
return s;




fig. 8
int sumadds() // suma de deasupra diag. secundare
{
int y=0;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(i+j<n-1)
y=y+a[i][j];




Ma gandeam la
fig. 1
int triunghi1()
{int s=0;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
if(i+j<n-1 && j<i)
s+=a[i][j];
cout<<"suma triunghi1="<<s;
}


Celelalte ma bat relativ.
Nu stiu ce conditii sa pun pentru celelalte figuri.


We stop looking for monsters under the bed when we realize they're inside of us.

nr913 wrote:
no really, dacã nu era așa țãrancã, și dacã era în bucurești, o luam de nevastã

0 0
  
Back to top
View user's profile Send private message
nr913
[Banned user]


Banned


Status: Offline
(since 24-10-2013 10:06)
Joined: 24 Apr 2009
Posts: 4224, Topics: 223
Location: România

Reputation: 60.3
Votes: 156

 
Post Posted: 21-01-2012, 22:04:24 | Translate post to: ... (Click for more languages)

1. i < j && i + j < n - 1
2. i > j && i + j < n - 1
3. i + j > n - 1
4. i < j
5. i > j && i + j > n - 1
6. i < j && i + j > n - 1
7. i + j < n - 1
8. i > j


Attitude - A little thing that makes a BIG difference
0 0
  
Back to top
View user's profile Send private message
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 -> Programming / Scripting / Database  


The time now is 01-12-2024, 22:41:02
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