Răspuns :
Răspuns:
#include <iostream>
using namespace std;
int main()
{
int hm,hf,mm,mf;
cout<<"Ora la care s-a trezit Alex (ora minut cu spatiu intre ele)"<<endl;
cin>>hm;
cin>>mm;
cout<<"Ora la care s-a trezit Florin (ora minut cu spatiu intre ele)"<<endl;
cin>>hf;
cin>>mf;
if(hm>hf)
cout<<"Alex";
else if(hm<hf)
cout<<"Florin";
else if (hm==hf)
{
if(mm<mf)
cout<<"Florin";
else if(mm>mf)
cout<<"Alex";
}
return 0;
}
Explicație:
#include <iostream>
using namespace std;
int main()
{
unsigned int ora1,minute1,ora2,minute2;
cout << "Florin -> ora : "; cin >> ora1;
cout << "Florin -> minute : "; cin >> minute1;
cout << "Alex -> ora : "; cin >> ora2;
cout << "Alex -> minute : "; cin >> minute2;
if(ora1<ora2){
cout <<"Alex";
}
if(ora1>ora2){
cout <<"Florin";
}
if(ora1==ora2){
if(minute1<minute2){
cout <<"Alex";
}
if(minute1>minute2){
cout <<"Florin";
}
}
return 0;
}