|
-
January 16th, 2013, 10:11 AM
#11
Re: I need very fast help, like within the hour, please!
lol i wish, i can ask but they wont answer, as i said "i have to do it myself by any way i can find out how or feagure out how, he simply wont tell me how, so he isnt an option to find out form"
also a LOT of the code is right now overlaping itself cuz i leave in every single thing i learned right now and once i get something done i delete out the crap. If anything is ununderstandebe because estonian i can translate most
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define RIDU 4
#define VEERGE 7
#define MAX 150
#define MIN 10
int main (void)
{
int maatriks [RIDU] [VEERGE];
int i,j;
int nTotal = 0;
srand(time(NULL));
for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
maatriks[i][j]=rand()%(MAX-MIN)+MIN;
}
}
printf("Genereeritud matrix on:\n\n");
for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
printf("%4d", maatriks[i][j]);
}
printf("\n\n");
}
printf("========================================\n");
printf("Kolmandast tulbast paremale jäävad tulbad\n");
for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
if (j>2) printf("%4d", maatriks[i][j]);
}
printf("\n");
}
printf("========================================\n");
printf("neljas tulp ja selle arvude summad\n");
for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
(nTotal += maatriks[i][3]);
if (j<1) printf("%4d", maatriks[i][3]);
}
printf("\n");
}
printf("----------------------------------------\n");
printf("viies tulp ja selle arvude summad\n");
for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
if (j<1) printf("%4d", maatriks[i][4]);
}
printf("\n");
}
printf("----------------------------------------\n");
printf("kuues tulp ja selle arvude summad\n");
for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
if (j<1) printf("%4d", maatriks[i][5]);
}
printf("\n");
}
printf("----------------------------------------\n");
printf("kuues tulp ja selle arvude summad\n");
for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
if (j<1) printf("%4d", maatriks[i][6]);
}
printf("\n");
}
printf("----------------------------------------\n");
printf("\n\n\n\n");
printf("Neljas tulp ja selle arvude summad\n");
j = 3;
for(i=0; i<RIDU; i++)
{
printf(" %4d", maatriks[i][j]);
}
printf("\n");
return 0;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|