Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstring>
- using namespace std;
- struct telefon
- {
- double pret;
- char nume[50];
- };
- struct telefon x,y;
- int main()
- {
- cin>>x.nume>>x.pret;
- cin>>y.nume>>y.pret;
- if(x.pret>y.pret)
- {
- cout<<"Cel mai scump telefon este:"<<x.nume<<endl;
- }
- if(x.pret<y.pret)
- {
- cout<<"Cel mai ieftin telefon este:"<<x.nume<<endl;
- }
- if(y.pret>x.pret)
- {
- cout<<"Cel mai scump telefon este:"<<y.nume<<endl;
- }
- if(y.pret<x.pret)
- {
- cout<<"Cel mai ieftin telefon este:"<<y.nume
- }
- if(y.pret==x.pret)
- {
- cout<<"Telefoanele au acelasi pret";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement