Commit 1affe2a9 by sameis

Tunnitöö2

parent 73f4e9c8
Showing with 32 additions and 0 deletions
#include <stdio.h>
int pea=0;
int k6rv=0;
int i=0;
int A[4][4]={{2, 3, -4, 3},
{1, 2, -3, 0},
{1, 2, 3, 4},
{1, 2, 3, 4}};
int main(void)
{
int i;
for(i=0; i<=3; i++)
{
pea +=A[i][i];
k6rv +=A[0+i][3-i];
}
if (pea < k6rv)
{
printf("Peasumma on %d \n", pea);
printf("K6rvalsumma on %d \n", k6rv);
}
else
{
printf("Peasumma on %d \n", pea);
printf("K6rvalsumma on %d \n", k6rv);
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment