#include <iostream>
using namespace std;
struct vec3{
float x;
float y;
float z;
};
vec3 operator+(const vec3 &a, const vec3 &b)
{
vec3 c;
c.x=a.x+b.x;
c.y=a.y+b.y;
c.z=a.z+b.z;
return c;
}
vec3 operator-(const vec3 &a, const vec3 &b)
{
vec3 c;
c.x=a.x-b.x;
c.y=a.y-b.y;
c.z=a.z-b.z;
return c;
}
vec3 operator-(const vec3 &a)
{
vec3 c;
c.x=-a.x;
c.y=-a.y;
c.z=-a.z;
return c;
}
vec3 &operator+=(vec3 &a, const vec3 &b)
{
a.x+=b.x;
a.y+=b.y;
a.z+=b.z;
return a;
}
vec3 &operator-=(vec3 &a, const vec3 &b)
{
a.x-=b.x;
a.y-=b.y;
a.z-=b.z;
return a;
}
vec3 operator*(const vec3 &a, const vec3 &b)
{
return vec3{a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x};
}
vec3 operator*(const vec3 &a, const float &b)
{
return vec3{a.x*b, a.y*b, a.z*b};
}
vec3 &operator*=(vec3 &a, const vec3 &b)
{
a.x=a.y*b.z-a.z*b.y;
a.y=a.z*b.x-a.x*b.z;
a.z=a.x*b.y-a.y*b.x;
return a;
}
vec3 &operator*=( vec3 &a, const float &b)
{
a.x*=b;
a.y*=b;
a.z*=b;
return a;
}
int main(){
vec3 v1 = {1,2,3};
v1 = v1 * 100;
cout<<v1.x << " " << v1.y << " " <<v1.z <<endl;
return 0;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}