Results 1 to 6 of 6
Thread: C++
Hybrid View
-
17th May 2013 21:37 #1Registered User
Join Date: Jul:2011
Location: Bulgaria
Posts: 23
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");
}
-
17th May 2013 21:56 #2
, ?
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.
-
17th May 2013 22:52 #3
Join Date: Apr:2006
Location:
Posts: 8,666
-
18th May 2013 00:35 #4
? : ) , , .
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.
-
18th May 2013 02:32 #5
Join Date: Apr:2006
Location:
Posts: 8,666
, ... Shit happens
-
17th May 2013 22:15 #6
...
- 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




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in