A
AlexL
Здравствуйте! в общем, суть такая: при компилировании в Code: :Blocks выдает ошибку:
'cout' was not declared in this scope
Как быть? Кто виноват? И что делать?
#include <iostream>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
//using namespace std;
int main () {
clrscr();
int n;
double r,l,h,s,sb;
cout<<" Vvedite geometricheskoe telo: \n";
cout<<" 1: kub \n";
cout<<" 2: shar \n";
cout<<" 3: cilindr \n";
cout<<" 4: konus \n";
cin>>n;
if (n>=0 && n<=4)
switch {
case 1:
cout<< "vvedite dlinu storon kuba "; cin>>l;
s=6*l*l;
cout<<"\n Plochad kuba: " <<s; break;
case 2:cout<<"Vvedite radius shara "; cin>>r;
s=4*3.14*r*r;
cout<< "\n Plochad shara: " <<s; break;
case 3:cout<< "Vvedite radius cilindra "; cin>>r>> "\n ";
cout<< "Vvedite visotu cilindra "; cin>>h;
sb=2*3.14*r*h;
s=sb+2*3.14*r*r;
cout<< "\n Plochad bokovoi poverhnosti cilindra: " <<sb<< "\n ";
cout<< "\n Plochad polnoi poverhnosti cilindra: " <<s; break;
case 4:cout<< "Vvedite radius konusa "; cin>>r>>"\n ";
cout<< "Vvedite dlinu obrazuychei konusa "; cin>>l;
sb=3.14*r*l;
s=sb+3.14*r*r;
cout<< "\n Plochad bokovoi poverhnosti konusa: " <<sb<<"\n ";
cout<< "\n Plochad polnoi poverhnosti konusa: " <<s; break;
default:cout<< "Nepravilnii vibor "; break; }
else cout<< "Neoravilnii vibor";
getch();
}
да и еще на clrscr (); ругается
'cout' was not declared in this scope
Как быть? Кто виноват? И что делать?
#include <iostream>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
//using namespace std;
int main () {
clrscr();
int n;
double r,l,h,s,sb;
cout<<" Vvedite geometricheskoe telo: \n";
cout<<" 1: kub \n";
cout<<" 2: shar \n";
cout<<" 3: cilindr \n";
cout<<" 4: konus \n";
cin>>n;
if (n>=0 && n<=4)
switch {
case 1:
cout<< "vvedite dlinu storon kuba "; cin>>l;
s=6*l*l;
cout<<"\n Plochad kuba: " <<s; break;
case 2:cout<<"Vvedite radius shara "; cin>>r;
s=4*3.14*r*r;
cout<< "\n Plochad shara: " <<s; break;
case 3:cout<< "Vvedite radius cilindra "; cin>>r>> "\n ";
cout<< "Vvedite visotu cilindra "; cin>>h;
sb=2*3.14*r*h;
s=sb+2*3.14*r*r;
cout<< "\n Plochad bokovoi poverhnosti cilindra: " <<sb<< "\n ";
cout<< "\n Plochad polnoi poverhnosti cilindra: " <<s; break;
case 4:cout<< "Vvedite radius konusa "; cin>>r>>"\n ";
cout<< "Vvedite dlinu obrazuychei konusa "; cin>>l;
sb=3.14*r*l;
s=sb+3.14*r*r;
cout<< "\n Plochad bokovoi poverhnosti konusa: " <<sb<<"\n ";
cout<< "\n Plochad polnoi poverhnosti konusa: " <<s; break;
default:cout<< "Nepravilnii vibor "; break; }
else cout<< "Neoravilnii vibor";
getch();
}
да и еще на clrscr (); ругается