Skip to content

Instantly share code, notes, and snippets.

@FatihBAKIR
Last active December 16, 2015 11:28
Show Gist options
  • Save FatihBAKIR/5427100 to your computer and use it in GitHub Desktop.
Save FatihBAKIR/5427100 to your computer and use it in GitHub Desktop.
#include <cstdlib>
#include <iostream>
using namespace std;
void Fonksyon1(int (*APointer)[4][6], int (*BPointer)[4][6], int rowCount, int colCount);
void Fonksyon2(int (*APointer)[4][6], int (*BPointer)[4][6], int rowCount, int colCount);
int main(int argc, char *argv[])
{
int A[4][6],B[4][6];
int x = 0;
for(int i= 0; i < 4; i++)
{
for (int j = 0; j < 6; j++)
{
A[i][j] = x;
x+=8;
}
}
Fonksyon1(&A, &B, 4, 6);
Fonksyon2(&A, &B, 4, 6);
system("PAUSE");
return EXIT_SUCCESS;
}
void Fonksyon1(int (*APointer)[4][6], int (*BPointer)[4][6], int rowCount, int colCount)
{
for(int i= 0; i < rowCount; i++)
{
for (int j = 0; j < colCount; j++)
{
int Sayi = (*APointer)[i][j];
int x = 0,y;
for(y=2;y<=Sayi;y++)
{
if(Sayi%y==0)
{
x=x+y;
Sayi=Sayi/y;
y--;
}
}
(*BPointer)[i][j] = x;
}
}
}
void Fonksyon2(int (*APointer)[4][6], int (*BPointer)[4][6], int rowCount, int colCount)
{
printf("SAYI\t\tASAL CARPANLARIN TOPLAMI\n");
for(int i= 0; i < rowCount; i++)
{
for (int j = 0; j < colCount; j++)
{
printf("%d\t\t%d\n", (*APointer)[i][j], (*BPointer)[i][j]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment