Results 1 to 3 of 3

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User froid's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 97

    Unhappy

    , N, N x N , .

    :

    #include <stdio.h>
    #define MAXCOL 10
    #define MAXROW 10

    void main (void); {

    int N, i, j;

    printf(Vuvedete realno 4islo opredelq6to razmara na amtrica") ;
    scanf(%d, &N);

    int a [MAXROW][MAXCOL];

    for (i=0; i<N; i++) {
    for (j=0; j<N; j++) {


    , .

  2. #2
    ! vbTheKing's Avatar
    Join Date: Sep:2003
    Location:
    Posts: 4,138
    .
    ''? * *
    - !
    ...

  3. #3
    Registered User
    Join Date: Feb:2006
    Location: Plovdiv
    Posts: 392
    a[n][n]
    Code:
    #include <stdio.h>
    #include <limits.h>
    
    int
    main(void)
    {
    	int n, i, j, sum_a, sum_b, max_sum = INT_MIN;
    
    	printf("Vuvedete realno 4islo opredelq6to razmara na amtrica: ");
    	scanf("%d", &n);
    
    	int a[n][n];
    	for (i = 0; i < n; i++)
    	{
    		for (j = 0; j < n; j++)
    		{
    			printf("Vuvedete[%d][%d]: ", i, j);
    			scanf("%d", &a[i][j]);
    		}
    	}
    
    	for (i = 1; i < n; i++)
    	{
    		sum_a = 0;
    		sum_b = 0;
    
    		for (j = 0; j + i < n; j++)
    		{
    			sum_a += a[i + j][j];
    			sum_b += a[j][i + j];
    		}
    
    		if (sum_a < sum_b)
    			sum_a = sum_b;
    
    		if (max_sum < sum_a)
    			max_sum = sum_a;
    	}
    
    	printf("max sum: %d \n", max_sum);
    	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
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |