Results 1 to 16 of 16
Thread: 2 ++.
Hybrid View
-
19th January 2011 18:02 #1
2 ++.
2 " " .
:Code:#include <iostream.h> int main() { int m,n,k,i,j,l; float a[m][n],b[n][k],p[m][k]; cout<<"vavedi m:"; cin>>m; cout<<"vavedi n:"; cin>>n; cout<<"vavedi k:"; cin>>k; cout<<"Vavedete masiv a:"; for(j=0;j<m;j++) { cout<<" "<<j+1<<"red:"; for(i=0;i<n;i++) { cout<<i+1<<"-i element:"; cin>>a[j][i]; } } cout<<"Vavedete masiva b:"; for(j=0;j<n;j++) { cout<<" "<<j+1<<"red:"; for(i=0;i<k;i++) { cout<<i+1<<"-i element:"; cin>>b[j][i]; } } for(j=0;j<m;j++) for(i=0;i<k;i++) { for(l=0;l<n;l++) p[j][i]=a[j][l]*b[l][i]; } for(j=0;j<m;j++) for(i=0;i<k;i++) { cout<<"p["<<j<<"]["<<i<<"]="<<p[j][i]<<endl; } return 0; }
( , ). . .
, .
( 2 6 )
Code:#include <iostream.h> int main() { int m,n,a[m][n],i,j; double sr; sr=0; cout<<"Broi uchenici:"; cin>>m; cout<<"Broi predmeti:"; cin>>n; for(i=0;i<m;i++) for(j=0;j<n;j++) { cout<<"a["<<i<<"]["<<j<<"]="; cin>>a[i][j]; } cout<<"Izvejdane na uchenika sys nai-visok sreden uspeh:"<<endl; for(i=0;i<m;i++) for(j=0;j<n;j++) { sr=sr+a[i][j]; } sr=sr/(m*n); cout<<"Sreden uspeh:"<<sr<<endl; return 0; }
-
19th January 2011 18:18 #2Registered User
Join Date: Oct:2003
Location:
Posts: 4,317
C .
, int n; float a[n]; cin<<n .
-
19th January 2011 18:34 #3
-
19th January 2011 19:30 #4
<offtopic>
: , .
- ,
, ( ).
Python .
</offtopic>
, bsb ,
, , ""-.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.
-
19th January 2011 19:56 #5
2- :
|ASUS RoG Z690-E i7-13700k@ 5.6/4.3Ghz + Kraken X63 216GB Kingston Fury Beast 6000hmz 32-40-40-28 | RTX4080 | 256GB 960Evo, 1TB 970Evo, 2x2TB 980Pro, 1TB 860Evo|HX1200|CM MasterCase Pro 5|
|Steam Deck 256GB | 36 TB Unraid NAS| Asus Z87-DELUXE i7-4790K 32GB DDR3|
TengaM#2700 / 7engaM
-
19th January 2011 22:48 #6
-
20th January 2011 09:08 #7Code:
float a[m][n],b[n][k],p[m][k];
, tengam - , .Code:float a[100][100],b[100][100],p[100][100];
-
20th January 2011 10:20 #8
OFF /*
, ? , .
*/ OFF|ASUS RoG Z690-E i7-13700k@ 5.6/4.3Ghz + Kraken X63 216GB Kingston Fury Beast 6000hmz 32-40-40-28 | RTX4080 | 256GB 960Evo, 1TB 970Evo, 2x2TB 980Pro, 1TB 860Evo|HX1200|CM MasterCase Pro 5|
|Steam Deck 256GB | 36 TB Unraid NAS| Asus Z87-DELUXE i7-4790K 32GB DDR3|
TengaM#2700 / 7engaM
-
20th January 2011 15:30 #9
-
20th January 2011 10:23 #10
-
20th January 2011 15:40 #11Registered User
Join Date: Oct:2003
Location:
Posts: 4,317
. , , , ? , .
-
20th January 2011 15:47 #12
-
20th January 2011 18:37 #13
, , .
: bsb

Code:#include <iostream.h> int main() { int m,n,k,i,j,l; float a[100][100],b[100][100],p[100][100]; cout<<"vavedi m:"; cin>>m; cout<<"vavedi n:"; cin>>n; cout<<"vavedi k:"; cin>>k; cout<<"Vavedete masiv a:"; for(j=0;j<m;j++) { cout<<" "<<j+1<<"red:"; for(i=0;i<n;i++) { cout<<i+1<<"-i element:"; cin>>a[j][i]; } } cout<<"Vavedete masiva b:"; for(j=0;j<n;j++) { cout<<" "<<j+1<<"red:"; for(i=0;i<k;i++) { cout<<i+1<<"-i element:"; cin>>b[j][i]; } } for(j=0;j<m;j++) { for(i=0;i<k;i++) { for(l=0;l<n;l++) { p[j][i]=p[j][i]+a[j][l]*b[l][i]; } } } for(j=0;j<m;j++) for(i=0;i<k;i++) { cout<<"p["<<j<<"]["<<i<<"]="<<p[j][i]<<endl; } return 0; }Last edited by martos1; 21st January 2011 at 20:52.
-
22nd January 2011 01:07 #14
2- .
- :
U[1]=5.25
EDIT:

Code:#include <iostream.h> int main() { int m,n,i,j; float a[100][100],u[100]; cout<<"Broi uchenici:"; cin>>m; cout<<"Broi predmeti:"; cin>>n; for(i=0;i<m;i++) for(j=0;j<n;j++) { cout<<"a["<<i<<"]["<<j<<"]="; cin>>a[i][j]; u[i]=u[i]+a[i][j]; } for(i=0;i<m;i++) { cout<<"Nai visok uspeh na uchenik u["<<i<<"] "<<(u[i]/n)<<endl; } return 0; }
---------- Post added at 01:07 ---------- Previous post was Yesterday at 21:01 ----------
, for
Code:#include <iostream.h> int main() { int m,n,i,j; float a[100][100],u[100],max=0; cout<<"Broi uchenici:"; cin>>m; cout<<"Broi predmeti:"; cin>>n; for(i=0;i<m;i++) for(j=0;j<n;j++) { cout<<"a["<<i<<"]["<<j<<"]="; cin>>a[i][j]; u[i]=u[i]+a[i][j]; } for(i=0;i<m;i++) { if(u[i]>max) max=u[i]; } cout<<"Nai visok uspeh na uchenik nomer "<<i<<" s uspeh "<<max/n<<endl; return 0; }Last edited by martos1; 21st January 2011 at 22:50.
-
22nd January 2011 12:01 #15@ alfa
Join Date: Nov:2007
Location:
Posts: 156
for, , . cout- , i.
-
22nd January 2011 22:22 #16




Reply With Quote



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