Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool func(int **arr,int size,int size2)
- {
- if (arr[0][0] != 0 && arr[size-1][0] != 0 && arr[0][size2-1] != 0 && arr[size-1][size2-1] != 0)
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- void kolos1()
- {
- int size = 4;
- int size2 = 4;
- int **arr= (int**)malloc(sizeof(int*)*size);
- for (int i = 0; i < size; i++)
- {
- arr[i] = (int*)malloc(sizeof(int)*size2);
- }
- for (int i = 0; i < size; i++)
- {
- printf("\n");
- for (int j = 0; j < size2; j++)
- {
- arr[i][j] = rand() % 100;
- printf("%d ", arr[i][j]);
- }
- }
- arr[0][0] = 0;
- printf("\n%d\n", func(arr, size, size2));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement