Results 1 to 2 of 2
Thread: C++
Hybrid View
-
10th May 2010 15:08 #1Registered User
Join Date: Apr:2005
Location: varna
Posts: 11
C++
0,5! ...
:cout. ?!?!?Code:#include <iostream> #include <iomanip> using namespace std; class student{ public: string name; double weight[30]; }student[100]; int n; int main() { double sredno_teglo=0; int n; do{ cout<<"Number of students:"; cin>> n; }while (n<1||n>30); int i; for (i=0;i<=n-1;i++) { cout<<"Ime na studenta:"; cin>>student[i].name; cout<<"Teglo na studenta:"; cin>>student[i].weight[i]; cout<<endl; } for (int i=0;i<n;i++) { sredno_teglo+=student[i].weight[i]; } cout<<"Srednoto teglo na studentite e:"; cout<< fixed << setprecision(1)<<sredno_teglo/n; cout<<endl; system("PAUSE"); return 0; }
-
12th May 2010 04:51 #2
setprecision(int) , () , .
, :
- ;
- " " - , , "";
- Comparing floating point numbers
;
- Minimax Approximations and the Remez Algorithm;




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