Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- #include <cstdlib>
- #include <cstdio>
- using namespace std;
- int main(int argc, char *argv[])
- {
- int x = 0;
- while(x>5 || x<1) //
- do{
- {
- cout<<"\n\n*******************MENU********************"<<endl;
- cout<<"1.Wprowadz wektor"<<endl;
- cout<<"2.Dodaj wektory"<<endl;
- cout<<"3.Odejmij wektory"<<endl;
- cout<<"4.Iloczyny wektorowe"<<endl;
- cout<<"5.Wyjscie z programu."<<endl;
- cout<<"Wybieram : ";
- cin>>x;
- system("cls");
- }
- double ax,ay,az,bx,by,bz,cx,cy,cz;
- switch (x)
- {
- case 1:
- cout<< "Podaj wspolrzedne wektorow: ";
- cout<< "Podaj A= "; cin>>ax>>ay>>az;
- cout<< "Podaj B= "; cin>>bx>>by>>bz;
- break;
- case 2:
- cout<< "A+B= "<<ax+bx<< "|" <<ay+by << "|"<<az+bz;
- std::cin.ignore();
- break;
- case 3:
- cout<< "A-B= "<<ax-bx<< "|" <<ay-by<< "|" <<az-bz;
- break;
- case 4:
- cout<< "AoB= "<<ax*bx+ay*by+az*bz;
- cx=ay*bz-az*by;
- cy=ax*bz-az*bx;
- cz=ax*by-ay*bx;
- cout<< "\n\nAxB= "<<cx<<cy<<cz;
- break;
- case 5:
- break;
- }
- }while(x!=5);
- system("PAUSE");
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement