Results 1 to 6 of 6

Thread: C++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jul:2011
    Location: Bulgaria
    Posts: 23

    Question C++

    , :

    A[N,N] , N [12,36] . , , .

    , , , , .

    #include<iostream>
    #include<stdlib.h>
    #include<stdio.h>
    #define N 36
    int main()
    {
    float A[N][N],sum=0,average,br=0;
    int i,j,m,n;
    do
    {
    printf("m=");
    scanf("%d",&m);
    }
    while(m<12||m>N);
    do
    {
    printf("n=");
    scanf("%d",&n);
    }while(n<12||n>N);
    for(i=0;i<m;i++)
    for(j=0;j<n;j++)
    {
    printf("A[%d][%d]=",i,j);
    scanf("%f",&A[i][j]);
    if(i>j&&A[N][N]>0)
    {
    sum=sum+A[i][j];
    br++;
    average=sum/br;
    }
    printf("Sredno aritmetichno: %f\n",average);
    }
    system("pause");
    }

  2. #2
    System.gc()'s Avatar
    Join Date: Apr:2007
    Location: back in time
    Posts: 1,075
    , ?
    UD3R|Q9550+1283|4x2 G.Skill@1066|MX500+1002FAEX+640AAKS+ST31 60|RX580-8GB|1841BLT|SS-760XP|Define7|z24i|Edifier S350DB
    geniusloci: ) ; ) ; ) ? nope|r.i.p.

  3. #3

    Join Date: Apr:2006
    Location:
    Posts: 8,666
    Quote Originally Posted by System.gc() View Post
    , ?
    , ... <iostream> m>N, N , m 12<m<36???? ?

  4. #4
    System.gc()'s Avatar
    Join Date: Apr:2007
    Location: back in time
    Posts: 1,075
    ? : ) , , .
    UD3R|Q9550+1283|4x2 G.Skill@1066|MX500+1002FAEX+640AAKS+ST31 60|RX580-8GB|1841BLT|SS-760XP|Define7|z24i|Edifier S350DB
    geniusloci: ) ; ) ; ) ? nope|r.i.p.

  5. #5

    Join Date: Apr:2006
    Location:
    Posts: 8,666
    , ... Shit happens

  6. #6
    ? noncho's Avatar
    Join Date: Sep:2010
    Location: Bulgaria
    Posts: 3,723
    ...
    - A[N][N], n m( ) N ..
    average=sum/br; .

    , .
    Asus TUF B550M # Ryzen 7 5700X # 4x8GB Corsair LPX @3600 C16 # Asus Phoenix RTX 3060 # Adata SX8200 Pro 512 # WD Blue SN570 1TB # Seasonic SSR-550FM # Mugen 5 PCGH # darkFlash DLM21 # BENQ SW2700PT

    >> www.NonchoILiev.com

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 |