Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void mnozenie(int x, int y, int z)
- {
- cout<<"Wektor po przemnozeniu to ["<<x*z<<","<<y*z<<"]"<<endl;
- }
- void mnozenie(int a, int b, int z, int y)
- {
- cout<<"Wektor po przemnozeniu to ["<<a*z<<","<<b*y<<"]"<<endl;
- }
- void mnozenie(int a, int b, int c, int d, int e, int f, int g, int h)
- {
- cout<<" Macierz po wymnozeniu to: "<<endl;
- cout<<(a*c)+(b*d)<<" "<<(a*b)+(d*h)<<endl;
- cout<< (e*c)+(f*g)<<" "<<(e*d)+(f*h)<<endl;
- }
- int main(){
- int a,b,c,d,e,f,g,h,z,y,x;
- cout<<"Mnozenie wektora przez liczbe"<<endl;
- cout<<"Podaj dane wektora[a,b]"<<endl;
- cin>>a>>b;
- cout<<"Podaj liczbe do przemnozenia przez wektor"<<endl;
- cin>>z;
- mnozenie(a,b,z);
- cout<<"Iloczyn skalarny dwu wektorow"<<endl;
- cout<<"Podaj [a,b] pierwszego wektora i [z,y] drugiego wektora"<<endl;
- cin>>a>>b>>z>>y;
- mnozenie(a,b,z,y);
- cout<<"Mnozenie dwu macierzy przez siebie"<<endl;
- cout<<"Podaj wartosc pierwszej maciezy"<<endl;
- cout<<"a b"<<endl;
- cout<<"c d"<<endl;
- cin>>a>>b>>c>>d;
- cout<<"Teraz podaj druga macierz"<<endl;
- cout<<"e f"<<endl;
- cout<<"g h"<<endl;
- cin>>e>>f>>g>>h;
- mnozenie(a,b,c,d,e,f,g,h);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment