int main() { int a,b,c; cin>>a>>b>>c; if (a%2==0) a=a*a; if(b%2==0) b=b*b; if(c%2==0) c=c*c; cout <<a<<" "<<b<<" "<<c<<endl; }
№3 #include <conio.h> #include <iostream> using namespace std;
int main() { float a, b, c; cin >> a >> b >> c; if(a < b && a < c) cout << a; else if(b < a && b < c) cout << b; else if(c < b && c < a) cout << c; _getch(); return 0; }
#include iostream
using namespace std;
int main()
{
cout << "2 + 2 = ?" <<end;
int a;
cin >> a;
if(a == 4)cout <<"true"<<endl
else{cout<<"false"<<endl;}
}
№2
#include iostream
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if (a%2==0) a=a*a;
if(b%2==0) b=b*b;
if(c%2==0) c=c*c;
cout <<a<<" "<<b<<" "<<c<<endl;
}
№3
#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
float a, b, c;
cin >> a >> b >> c;
if(a < b && a < c)
cout << a;
else if(b < a && b < c)
cout << b;
else if(c < b && c < a)
cout << c;
_getch();
return 0;
}
#include <vector>
using namespace std;
int main() {
cout << "Введите вектор (0, чтобы закончить):\n";
float in;
vector<float> a;
while (true) {
cin >> in;
if (in == 0)
break;
else
a.insert(a.end(), in);
}
float p, x, y;
cout << "x = ";
cin >> x;
cout << "y = ";
cin >> y;
p = 1;
for (int i = 0; i < a.size(); i++) {
if ( (a[i] >= x) && (a[i] <= y) )
p *= a[i];
}
cout << "p = " << p << '\n'
<< "a[]:";
for (int i = 0; i < a.size(); i++) {
cout << a[i] << ' ';
}
return 0;
}