Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
haloog
/
IAX0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
49371674
authored
Sep 19, 2017
by
haloog
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kommentaar
parent
065461ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
Praktikum2/Prog I 3.tud.c
Praktikum2/Prog I 3.tud.c
0 → 100644
View file @
49371674
#include <stdio.h>
int
main
(){
int
S
=
0
;
int
i
=
0
;
int
N
=
0
;
while
(
N
<=
0
){
printf
(
"Sisesta rea pikkus N:"
);
scanf
(
"%d"
,
&
N
);
}
int
A
[
N
];
do
{
scanf
(
"%d"
,
&
A
[
i
]);
printf
(
"Sisestatud on %d."
,
A
[
i
]);
i
++
;
}
while
(
i
<
N
);
for
(
i
=
0
;
i
<=
N
;
i
++
){
if
(
A
[
i
]
>
0
&&
i
<
N
){
S
=
S
+
A
[
i
];
}
}
printf
(
"Positiivsete elementide summa on %d"
,
S
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment