Results 1 to 5 of 5
Thread: C++
Hybrid View
-
28th January 2011 20:30 #1
C++
, , :
error C2296: '/' : illegal, left operand has type 'double *'
: s[i] = s[i]/n;
double?
e :
Code:#include <iostream.h> #include <process.h> void main () { ///////////////////// double n, m; int * * a; double * * s; double * * g; int i,j; //////////////////// /////////////////// do{ cout<<"Vuvedete N v intervala ot 10 do 30: \n"; cin>>n; }while(n<10 || n> 30); do{ cout<<"Vuvedete M v intervala ot 4 do 10: \n"; cin>>m; }while(m<4 || m> 10); //////////////////// /////////////// n = n+1; m = m+1; /////////////// /////////////////// a = new int *[n]; s = new double *[n]; g = new double *[n]; // for(i=1; i<n; i++){ a[i]=new int [m]; } /////////////////// ////////////////// for(i=1; i<n; i++){ for(j=1; j<m; j++){ cout<<"Vuvedete ocenka za student "<<i<<" i ocenka po predmet "<<j<<"\n"; cin>>a[i][j]; } } ////////////////// //////////////////// for(i=1; i<=n; i++){ s[i] = 0; for(j=1; j<=m; j++){ s[i] += a[i][j]; } } //////////////////// ////////////////// for(j=1; j<=m; j++){ g[j] = 0; for(i=1; i<=n; i++){ g[j] += a[i][j]; } } /////////////////// /////////////////// cout<<"Sredni ocenki na studenti: \n"; for(i=1; i<=n; i++){ s[i] = s[i]/n; } /////////////////// /////////////////// system("Pause"); }.
-
28th January 2011 21:55 #2Registered User
Join Date: Dec:2007
Location: Sofia
Posts: 366
-
28th January 2011 22:02 #3
-
28th January 2011 22:23 #4Registered User
Join Date: Dec:2007
Location: Sofia
Posts: 366
's' , .
..
. 'n' 'm' double, int? 'g'?Code:double *s; ... s = new double[n];
-
28th January 2011 22:42 #5
,
, . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel




Reply With Quote

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