Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
anljam
/
Tunnitoo0310
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
d9b89a05
authored
Oct 03, 2017
by
anljam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parents
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
0310
0310
0 → 100644
View file @
d9b89a05
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
srand(time(NULL));
int n, m, i, j, k;
int MaxN = 10;
int MaxM = 20;
int A [MaxN] [MaxM];
int SummaMaatriks [3];
do
{
printf("Sisesta N: ");
scanf("%d", &n);
printf("Sisesta M: ");
scanf("%d", &m);
}while ((n < 7 || n > MaxN) || (m > MaxM || m < 0));
for (i = 0; i < n; i++)
{
for (j = 0; j < m; j++)
{
printf("Sisesta element A [%d][%d]: ", i, j);
A[i][j] = rand () % 200 - 100;
printf("%d\n", A [i][j]);
}
}
k = 0;
for (i = 7; i < n; i++)
{
SummaMaatriks[k] = 0;
for (j = 0; j < m; j++)
{
if (A [i][j] < 0)
{
SummaMaatriks[k] = SummaMaatriks[k] + A [i][j];
}
}
k++;
}
i = 7;
for (k = 0; k < n-i; k++)
{
printf("SummaV22rtus : %d \n", SummaMaatriks [k]);
}
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