#include < iostream> #include < sstream> using namespace std; struct vector3 { int x, y, z; vector3() {} vector3(int x, int y, int z): x(x), y(y), z(z) {} vector3 operator + (vector3 v1) { return vector3(this-> x+v1.x,this-> y+v1.y,this-> z+v1.z); } std: : string tostring() { std: : stringstream s; s < < "(" < < this-> x < < "," < < this-> y < < "," < < this-> z < < ")"; return s.str(); } }; int main() { vector3 v1(1, 2, 3); vector3 v2(4, 5 ,6); vector3 v3; v3 = v1 + v2; cout < < v3.tostring(); }
timsch12
23.02.2020
Реализация на с++ уровень а #include< iostream.h> using namespace std; int main(){ int a,b; cin > > a > > b; double s = 0.5 * a * b; cout < < s < < endl; return 0; } уровень b #include< iostream.h> using namespace std; int main(){ int n; cin > > n; (n%3==0) ? n*2 : n+n%3; cout < < n < < endl; return 0; } уровень c #include< iostream.h> using namespace std; int main(){ int summa = 0; for(int i = 1; i < 100; i+=2){ summa += i; } cout < < summa < < endl; return 0; }
∧-с)∧-а равносильно выражение -а∧(в∧с)
не то скопировала:
-а∧(в∨с) - это ответ! прошу прощения! устала: