User
Pass
2FA
 
 

Pascal Program.

 
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 Message1038
Danii

[Why so Serious?!]



Status: Offline
(since 27-03-2020 19:55)
Joined: 22 Sep 2010
Posts: 1508, Topics: 93
Location: Oltenita

Reputation: 183.4
Votes: 36

   
Post Posted: 11-10-2011, 12:36:52 | Translate post to: ... (Click for more languages)

Ma poate ajuta cineva cu o problema ?
Code:
se citeste de la tastatura o matrice n linii n coloane. Sa se determine pt aceasta matrice linia de suma maxima

Are cineva vreo idee ?



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


Banned


Status: Offline
(since 03-10-2013 13:05)
Joined: 25 Aug 2010
Posts: 2166, Topics: 119
Location: In ciorba.

Reputation: -485.9
Votes: 36

   
Post Posted: 29-04-2012, 00:06:11 | Translate post to: ... (Click for more languages)

{numarul de linii si coloane}
repeat
write('n='); readln(n);
until n>1

{citirea matricei}
for i:=1 to n do
for j:=1 to n do
begin
write('a[',i,',j,']=');
readln(a[i,j]);
end;

{rezolvarea problemei}
max:=-1; c:=0;
for i:=1 to n do
begin
s:=0;
for j:=1 to n do s:=s+a[i,j];
if s>max then
begin
max:=s;
c:=i;
end;
end;

{afisarea rezultatului}
writeln('linia cu suma maxima este: ',c);

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
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 02-12-2024, 04:39:35
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