Thursday, March 25, 2021

Дууны долгион утсаар дамжих

 


2 comments:

  1. #include
    int main()
    {
    int a[100],n,i;
    int max;
    printf("N=");
    scanf("%d",&n);
    for(i=1;i<=n;i++){
    printf("A[%d]=",i);
    scanf("%d",&a[i]);
    }
    max=a[1];
    for(i=2;i<=n;i++)
    if(max>a[i])
    max=a[i];
    printf("max=%d",max);
    }
    MASSIVE

    ReplyDelete
  2. #include
    int main()
    {
    int i,j,n,a[10][10];
    printf("n=");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    for(j=1;j<=n;j++)
    {
    printf("A[%d][%d]=",i,j);
    scanf("%d",&a[i][i]);
    }
    {
    if(i%2==0)
    a[i][j]=1;
    else if(j%2>=0)
    {
    printf("0");
    }
    }
    for(i=1;i<=n;i++)
    {
    printf("\n");
    for(j=1;j<=n;j++)
    printf("%d\t",a[i][j]);

    }
    }
    2HEMJEEST MASSIVE

    ReplyDelete