0 like 0 dislike
778 views

The program below can compare time which is generated by class CTime but it seems not working properly. Please help to fix it. Remember that YOU CAN ONLY ADD YOUR CODE INSIDE THE SPECIFIC AREA

#include <iostream>
#include <cstdlib>
using namespace std;
class CTime
{
   private:
      int hour,min;
      double sec;

   public:

//Your code from here

 

//to here
};

int main(void)
{
   CTime t1(4,13,51.3);
   CTime t2(5,44,30.3);
   
   if(t1>t2)
      cout << "t1 is larger than t2" << endl;
   else
      cout << "t2 is larger than t1" << endl;

   if(t1<t2)
      cout << "t1 is smaller than t2" << endl;
   else
      cout << "t2 is smaller than t1" << endl;
   
   system("pause");
   return 0;
}

 

[Exercise] Coding (C) - asked in C++
ID: 24827 - Available when: Unlimited - Due to: Unlimited
| 778 views
0 0
Called for Help
0 0
Called for Help
0 0
Called for Help
0 0
Called for Help
0 0
Called for Help

26 Answers

0 like 0 dislike
Hidden content!
#include * * *** **

using namespace std;

class CTime

{
*** *** * * * *** *****
*** *** * * *** * ** * ** * * ** ** hour,min;
* * * * ** ** ***** ** * sec;


** * * * *****



//Your code from here
** * ***** * * h, int m, double s){
* *** * *** *** * * ** * * * *** * = h;
* **** * ** * * * ** *** **** **** * = m;
**** *** * * * * * * **** * * * ** = s;
* * **** * *** * **


*** * * * * * bool *** ***** ** ** (const CTime * ** const CTime * **
* * * * ** ** ** * ****** ***** ** * * * * + num1.min + * * > **** ** + num2.min + * * **
* ** **** ** ** **


* * ** * **** ******* * bool * * ** (const CTime * ** ** const CTime * * * * **
********* * * * * *** ** * * * * * * * * **** *** + num1.min + num1.sec) < *** * + num2.min + ** ****
** * * **** ** *



//to here

};



int * **

{
* ** *** * ** * * * * *** **
* * ** * * **** * * * ** *


** *** ** * * * * **
* ** ** * ***** ** ** ** * * * *** **** *** ***** * * ** * is larger than ** * *** endl;
* *** ** * * * *
* * * * **** * ** * * ** **** *** * * * *** * * ** * is larger than * ** * ** * endl;


** * ** *** * * **** *** *
** * *** * *** *** * ** * * *** * * ** ** is smaller than * * * * * endl;
* * * *** ** *
* **** * * ** * ** ** ** ** * ***** **** * is smaller than * ** * * * **** * * endl;


** **** * *** ** ** * ** ** ***
* * ** * **** * 0;

}
answered by (126 points)
0 like 0 dislike
Hidden content!
#include <iostream>

#include <cstdlib>

using namespace std;

class CTime

{
* * * * * * **
**** *** * * ** *** *** * ** hour,min;
** * ***** ** * * **** **** *** ** * sec;


* ** * * * * ** ***
** * * * ** * * * * ** a, int b,double c){
* ** ** ** ***** ** * ****** * * ** * ** * * *
* ** ** ** * * * *** ****** * * ******* *
*** *** *** *** * ** ** * * ** ** * * **** * **
***** **** * * * *
* * * *** * ** operator>(CTime& t2){
* ** * ** **** ** **** * * ** * * * **** * *** * s1,s2;
* ** * * ** ***** * * * ** ****** * ** ** ** * **** * * * * **** * ** * **** ********
** * * ****** *** ** *** * ** * ** ** ** * * ** ** ** *** **** * *
* * * * ***** * * * *** ** *** **** * *** ** ***
* *** ***** * * ** *** *** * * * ****** ** * *** *** *** * * * 1;
*** * **** *** * ** * * ***** * ***
** * **** ** * * * **** * **** ** * *** * ***** ** * * 0;
*** ** * ** *** * *
* ** **** * * ** * *** * operator<(CTime& t2){
* ** * * *** ****** * * ** ** *** * ********* s1,s2;
*** ** * * ** * *** * ** * ** * * * ** * ** * * ****** ** * **** *** * * **
* *** * ** * ** ** *** * ** * * ** ** * * ** ** *** * * * ** *
** * ** * ** * * ** * * **** *** ** **
* ** ** * * * ** **** *** ** **** ** * *** * ** * ** ** * *** * *** 1;
* * * * * ***** * * ** ** * *** ** * * * **
* **** **** *** ***** * * ** ** * ** * ** ***** *** * * ** 0;
* * * * *** * * ** * ** **





};



int main(void)

{
*** ***** ** ** ** ** t1(4,13,51.3);
***** * ******* *** t2(5,44,30.3);

   
* * * ** ** * * *** ***
* ** * ** * ***** *** * * *** ** ** << "t1 is larger than t2" << endl;
*** * * *
* * *** * ** * * ** * * * *** << "t2 is larger than t1" << endl;


** * ** * * * * * ***** *
* ** **** * * * ** * *** * * << "t1 is smaller than t2" << endl;
*** * * * ** * ** **
* ** ***** **** **** * * *** ** << "t2 is smaller than t1" << endl;
** * **** *
* ** **** * * *** ** ** * * ** ******** *
**** * ** *** *** ** 0;

}
answered by (-249 points)
0 like 0 dislike
Hidden content!
#include <cstdlib>

using namespace std;

class CTime

{
* * *** ** **
**** * * ** ** * ** * * * * hour,min;
** ** * * * * * * * * sec;


* * * * * * **
* * * *** ***** *** ** *** * * ** a, int b,double c){
* * ***** * ** **** * *** * * * ***** **** *** *** *
* ** ** ****** *** * * * * * * ** * ** ** * ** **
*** * * * ** **** * * ***** * * * * * *** * * ****
** * *** * **** **
* * * * *** *** * * operator>(CTime& t2){
* * **** * * * * **** ** * * * * * * ****** * s1,s2;
******* * ** ** ** * * * * *** * * * * *** * *** * * **** ** * * * * ** * *
* * * ** ** ** * ***** ** * *** ** * *** *** *
****** * * * * ** * *** ****** * * **** ** *** * ***** ***
* * **** * * * ** * * ** *** * * ** * *** * * ** * ** ** * * 1;
** * *** * * ** ****** * * * * * ** * * **** * *
* * **** * * * ** ** ** **** * *** * * **** ** ******* 0;
* * ** ** *** ******* *
* **** *** ** ** ** operator<(CTime& t2){
** ** * * *** **** *** ** * *** * * ** * s1,s2;
** ** ** * * * *** *** *** * * ** * ** *** ** * ** ** ** **** * *** *
* ** ** ** * ** * * ****** * * * *** ** * *** * * * *
**** * * ** *** ****** * * *** ** *** ** ** **** ****
****** ** ** **** * * ** ** ***** * * *** * * * * *** * **** 1;
* * ** * ******* * ** * **** **** *** ***** ** ***
* ********* * * * * * * **** * **** * ** ** ** * ** **** * * 0;
** ** *** * **** * *





};



int main(void)

{
* ** * *** ** ** t1(4,13,51.3);
*** * ***** * * t2(5,44,30.3);

   
* ** ** ***** * ** * * ** *
* ***** **** * ** ** ** ***** * * * << "t1 is larger than t2" << endl;
* ** * * ** **
*** * * * ** * * * ** * * ** << "t2 is larger than t1" << endl;


** ** *** * **
* ** * * * ***** ** ******* * ** ** * << "t1 is smaller than t2" << endl;
* *** * ** **
**** ** * ** *** *** ** ** ** << "t2 is smaller than t1" << endl;

   
** ** * ********** * ** ** * *** ****
** * *** * ** * *** * 0;

}
answered by (-249 points)
0 like 0 dislike
Hidden content!
#include * * **** **

#include ** * ** ** * *

using namespace std;

class CTime

{
* *** * **** * * *
** ** ****** ** * **** ** *** ** * *** hour,min;
* * *** ********* **** ***** * sec;


** *** * *** *
* **** ** ** *** ** * * ** * ** * * * * x,int y,double z){
* * * * *** **** *** * ** * ** **** **** ** * *** ** * * * *** ** ** ** = x;
* ** * ** ** * **** ** * *** * *** *** * * *** = y;
*** ** * * *** * * * ********* * ***** ** *** * * * * * = z;
* *** ***** * ***** ** * * *
* * * * ***** * *** ** * *** * bool * ** ** * *** * ** * X, const * *** * Y);

* **** * * * *** *** * ***** * ** * bool * * ** * * ** X, const ***** ** Y);

};



bool operator < (CTime * * lhs, CTime * * * * * rhs)

{
**** ** *** ** *** * * ** * lhs.hour < rhs.hour;

}



bool operator > (CTime * *** lhs, CTime *** rhs)

{
******** * * **** **** * * ** lhs.hour > rhs.hour;

}



int main(void)

{
** *** * ** ** * * *** *** * *
** * **** *** * * * **** *
* * ** *
* ** ** * * **** ** *
*** * * * ***** ****** ***** * * ** ** **** is larger than * * * ***** * * endl;
* * *** * *** ** *
*** ** * ** **** * ** *** *** ** * ** * * is larger than * * * * * ***** *** endl;


** ******* ** ********* *
** * * * *** ****** *** * * * * ** * *** ** ** is smaller than * ** *** * endl;
*** ** ** *** * **
* ** * * ********* ** ** ** ******* * ** * * * "t2 is smaller than ** ** ** ** endl;
* ** * * *
* * ** * *** *** * **** * ** * **
* ** * *** *

}
answered by (-136 points)
0 like 0 dislike
Hidden content!
#include * * *** * * ** *
**** ** * *** **

using *** ** std;

class CTime

{
**** * * *** ***** ** * *
****** *** **** * *** * * *** ** *** ** *
* * * ** * * * **** *** * sec;


**** ** ** ** *** * *
* ** * * ***** * *** * x,int y,double z){
* **** * **** * ** ** * * **** * * hour = x;
** * * * * * ** **** * * * * **** ** *** min = y;
**** * * ** * * *** **** * *** ** * sec = z;
** * ****** * * *
* **** * * * * ****** bool ** ** * ** * X, const ** ** * * Y);

** *** * * * ** *** ** * * * ** *** bool ** **** * ** * **** X, const ** * Y);

};



bool operator < (CTime ** lhs, CTime ****** * rhs)

{
* ** * * *** ** * *** lhs.hour < * *

}



bool operator > (CTime *** * ** * lhs, CTime * ****** rhs)

{
* ** * * *** * * ***** lhs.hour > *

}



int ******

{
* ** * *** *** * ***
** * * * *** ** * * **
** ** **** * * ** *
** ***** *** * * *** *
* * * * ** ******** ****** * ** ** **** *** is larger than *** * * ****** endl;
* * * * **
***** ** ** * *** ** ** * * ** * * ** * ** ** *** is larger than * * * ** ** endl;


** * * * * * * ** *
***** ******* ** *** * * * * * * * ** * * *** is smaller than *** * ** * endl;
* ** * * * * ** *
* * *** * * * * * * ** * * * ** *** ** * * * is smaller than ***** * * endl;
*** * ** * *
* * * * ** ******** ** ** * * ***
* * **** *** * * * ** ** ** 0;

}
answered by (-134 points)
0 like 0 dislike
Hidden content!
#include <iostream>

#include <cstdlib>

using namespace std;

class CTime

{

   private:
** * **** * * * ** * * ** * **** * hour,min;
*** * ** ** * *** *** * * *** * * sec;



   public:


* * * ***** * ** * * h, int m, double s)
** ***** * * * * * *
* * * ** *** * *** * **** * * * * * ** = h;
***** * * * ** ** *** * *** ** * ** ** **** * * = m;
**** ** * *** * * * **** ** * * ****** ** = s;

    }


* * ** * ******* operator>(const CTime t2)

    {
* * ***** * ****** ** * * * * * ** *** * * ** > t2.hour)
* * ** * ** * * * *** *** * * * * *** *** * ** *** * * * * *** true;
* ***** *** * ** * * **** * **** * * * * * if(hour == t2.hour)
** * * * *** * * * * * * ** * * **** ****
* * ** * *** * * ** ** * ** ** * **** * * ******* *** * * ******** * ** > t2.min)
** ** ** * * ** ** ** *** * ** **** **** * ** * ** ** ** * ** * * ** ** * ** true;
** ** ** **** * ** ** * * * ** * * * ** ** * * * * ******** * * if(min == t2.min)
* ** * ****** ** ** **** * ** ** ** * * ** ** * ******* ******* ** * ** * * ** * **
* * * * * * * *** * **** ****** * ** ***** *** * * * **** * ** ** ** * ** * * ** * > t2.sec)
* *** *** * ** * * *** **** * * * * * *** * ** *** ** * * * ** * * * *** **** * ** * * ****** true;
* * *** ** ** * * *** * * **** * ** * ****** * * * * * * * * * ** * * * ** *** ** * **
***** *** * * ** *** ***** * ** *** *** * *** * ******* ** * * * *** ** * * * ****** * ** ** * * *** *** ***** ** false;
* * ** ** ** * * * *** * **** ** ** * ****** * * * ** ** * * *
*** * ***** * ** * ** * ** * ** ** * * **** * * ***** *** *** ***
** **** * ** * *** ** * * * *** * * * * **** * * * * ** * * ** * * *** * * false;
*** *** * * * * * * * ** * * ** * *
* * * ** **** **** * * ** ** * *** *
* **** * * * ** ** * ****** ** * ** *** * ** ** ** * * * ** * false;



    }
*** * ** * ** ** operator<(const CTime t2)

    {
* * ** * ** ***** * * ** * ** * ** * < t2.hour)
***** * ** * * ** * * *** ** **** ****** ** *** ** * *** ** * true;
*** * * *** * * ** *** * * * * *** ***** * if(hour == t2.hour)
** ** ** **** ** * * ** * * * * *
* * * ** * * * ** ** ** **** * * * ** * * ** * ** **** **** * *** * * * < t2.min)
*** ** ** ** * *** ***** ** *** ***** * * * * * * ** * * ** *** true;
* ** * * *** * * * *** *** ** * * * *** * ** ***** *** * * * ***** * if(min == t2.min)
* * *** * ** *** *** *** **** * * * * * *** ** * ** ** ** ** *
** * * **** * * * * ** ** *** ** *** * * * **** ** * * **** * * * ** ** * < t2.sec)
**** * **** ** ** * * * *** * **** **** *** ** * ***** *** **** * * ****** * ** **** ***** * * * * **** * *** * true;
*** * ** ** ****** * * *** **** ** ** * * * ** ** **** ** *** ** ****
* ****** * * * * ** * * ** ** * * * * *** * * * * * ** *** ** ***** * * **** * ** * ** *** ** ** ** false;
*** * ** ** * * * *** * ** *** * * *** * *** * * * **
* * *** ** * ** *** * * * ** ** * * * * ***** * ** ** *
** **** * * *** **** *** ** **** **** * ******* **** *** ** * **** **** ******* ** * * **** false;
* *** *** * ** *** **** * ** ** *** *** ** *
* * * ***** * * **** * * * * * * * ** *** **
* * ******** *** ** * ** * * ** ** *** * ** * ******* ** ****** *** ** * *** false;



    }





};



int main(void)

{

   CTime t1(4,13,51.3);

   CTime t2(5,44,30.3);


*** * * * *** * ** *
* * * ** ** ** * * ***** * * * * ** * << "t1 is larger than t2" << endl;

   else
* ** * * * ****** * * * ** **** ** << "t2 is larger than t1" << endl;


* * ** * *** * ** ***
* *** ** * ***** ** ** * * *** << "t1 is smaller than t2" << endl;

   else
** * * * * * * * ** * ** * * * << "t2 is smaller than t1" << endl;


****** ** * * *** ** *** *** *

   return 0;

}
answered by (-364 points)
0 like 0 dislike
Hidden content!
* **** * * * * *** ** *

#include * * *** *

using namespace std;

class CTime

{
* ** * *** ** **** *
** * **** ** * **** **** * ** ** hour,minute;
* ** * * ** **** **** * * ** * ** * * sec;


* ** * ** * ** *

CTime(int hour_,int minute_,double sec_)

{
*** * **** * * = hour_;
* ** * * ** *** * * * = minute_;
** * ***** * * *** * = sec_;

}

int * * * * * **** * **

{
**** ** ***** * s1,s2;
** ** * ** * * * = *** * * * *** * * ** * * * *
** ** * * ** ** ** * = ** * **** ** **** *
*** * ** ** * * *** * *
* * **** * **** ** * ** * ***** * * ** * * 1;
* ** * * * * ***
**** ** ****** *** * *** ******* * **** * * * 0;

}

int *** ***** ***** * ** *

{
*** ** * ** ****** s1,s2;
***** ** ** * * = * * ** *** * * ** * ** *** *
* * * * * ** ** * * = ** * * * * * ***
* *** ***** *** * * * *
*** * ** ** * * **** * * ** * * *** * ***** ** 1;
** * ** * ** **** *****
* * ** *** * ** * **** * * * * * ** ** ** 0;

}

};



int main(void)

{
* ***** * *** ** * *** t1(4,13,51.3);
***** * * * ** * * t2(5,44,30.3);


** * * * * *** ** **
***** * * * * * * * *** * ** ** * *** * *** "t1 is larger than t2" * * * ** *** endl;
* * * ** *
* *** ** ** ** * * ** * * ** ** ** * * * * "t2 is larger than t1" << endl;


* **** ** * ** ** * * *
**** * ********* * * ** * **** * * * * * *** "t1 is smaller than t2" * * * endl;
* ** ** * ** * ***
** *** * **** * ****** * * ** * *** ** "t2 is smaller than t1" << endl;


** ** * * ** * ** * ***** * **
** * **** * * * 0;

}
answered by (-367 points)
0 like 0 dislike
Hidden content!
#include <iostream>

#include <cstdlib>

using namespace std;

class CTime

{
**** ***** **** ***
*** * *** * * **** *** **** ** * * hour, mins;
* ** * ** * ** * ** * * sec;


***** ** * ** * ***** *
* * * * * ***** **** * * * * * * **** * ** in_A, int in_B, double in_C){
* * ***** ** *** * * ****** ** ** * * ** *** *** * ** * ** * ** = in_A;
* ** *** **** * * ** * ** * ** * ** * ** *** ** ***** **** *** * = in_B;
*** * * * * * ** * * ***** *** * * ** ** ** ** * *** ** * = in_C;
* * **** ** * ******* ** ** * ** * * * ** * * * * *
** ** * ****** * *** ** **** * * operator > (const CTime B){
* * * * * * ** ** ** * *** ** ****** * * ** * * ** ** * ** **** *** result_A, result_B;
*** * *** * **** ** ** * ** * * * * * ** ** * * * * * ** **** * ** ** = (3600*hour)+(60*mins)+(sec);
**** *** ** ** * ** **** ** ** ** * *** ** *** * ** *** *** = * ** ** * * * *
* * *** ** ** * **** ** * ***** * * * ** * * ****** * ** * * ** > result_B)
* * * ** * ** * * * * * * ** ** * * * ** * *** **** * * * ** * **** *** * *** ** true;
* *** * * * *** * * **** * ******* ** * ** * * **** * * ** * * **
* * * ** ** ** ** * **** **** ** ** ** **** ** * * * * *** * **** * * * ** *** * * * false;
* ** ** ** * * * * *** *** * * *** **
*** * * *** ** * * * **** * ** **** * * * operator < (const CTime B){
* * **** *** ** ** ** ** * ** * **** * **** ****** ** ** * ** * result_A, result_B;
* *** **** **** * *** ** * ** * ** * * *** ************ * * ** ** * * = (3600*hour)+(60*mins)+(sec);
* ** * *** * *************** * * * *** * * **** *** * ** * * * = *** ** * * * * **
* ** * *** ** ** * * * ** ********* * * ** * * ** **** *** * ** * < result_B)
** * * * * * **** ** *** * * * * * ** ***** ** * * ** *** ** ** ** * * *** *** * true;
* *** * * ** ** * *** *** ** * ** ****** **** **** ** ****** * *******
***** * ** * *** * **** * * ** *** **** ****** * ****** * *** ** **** * * ** ** * ** * ** false;
**** ** * * * **** * * * ******* * ***** ******

};



int main(void)

{
** ** ** ** * * *** t1(4,13,51.3);
* * ** * * * t2(5,44,30.3);


** * ** *** *** * *
** ** * * ** * ** * *** * ** * << "t1 is larger than t2" << endl;
** *** * * ** ***
* * ** * **** *** * **** * * * * * << "t2 is larger than t1" << endl;


***** * * ** *** *** ** *
* * ** * ******* ** * *** * * * * << "t1 is smaller than t2" << endl;

   else
* ***** ** *** * * ** **** ** **** ** << "t2 is smaller than t1" << endl;


* ** ** *** *** ***** * ***** * *
** ** * * ** * 0;

}
answered by (-581 points)
0 like 0 dislike
Hidden content!
#include ** * * * *****

#include *** ** * **

using namespace std;

class CTime

{
*** ** **** * * *
***** ** ***** ** * * * * ** hour,min;
*** * **** * ** * * * * * **** sec;


** *** * * * ** * * *



//Your code from here
***** ******* * * **** hr, int mn, double s);
* ****** * *** * * *** ** ***** * ** CTime& b1){
**** ***** * * ** * ** * **** * * * * * *** *** > b1.hour)
* * * * * ** * * * * * * * * **
****** * * * * * * ** **** ***** ***** * ** ****** ** * ** 1;
** ** * * * * * ** * **** ** * ** * ** *** *
* * * ** *** ********* * * ** ** ** * * ** **** *** * ** ****** ** 0;
*** ** * ** * * ** ***** ** * ** *** **
* ***** **** *** * *****


* *** **** * * ** * * * * * CTime& b1){
** * ** * * * * * * *** ** *** * *** * ** ***** * * * * < b1.hour)
**** *** * **** ***** ** * ** * * *
* * * ** * ** *** * * **** * * * * **** * ** *** *** *** ** * ** * * * 1;
* *** ** ***** ** *********** *** * **** * *** * *
* ** * * ** * ** * * ** * * * * * *** * * * ****** ** * 0;
*** * * ** ** **** ** * ** * * ** * *
* ***** * **** *** ***



//to here

};


* **** *** * hr, int mn, double s)

{
**** * * *** * ** ** = hr;
* * *** ***** ** * *** * * *** = mn;
* * *** ** * * *** = s;

}



int main(void)

{
** ***** * * * * *** t1(4,13,51.3);
* * * ** * ** * t2(5,44,30.3);


*** * * * ** * *** ***
* ***** ***** * * ** * * * ** *** * * "t1 is larger than t2" << endl;
** * * ** * *
**** * * ** * *** ** * **** *** *** * * * ** "t2 is larger than t1" << endl;


* * ** * * ** *
*** **** * * * * *** ***** * * * * * ***** "t1 is smaller than t2" * * ** *** endl;
*** * * ** * * * ****
* * * * * * **** * ** * * * * << "t2 is smaller than t1" ** * * *** endl;


**** *** * ** ** **
** ** ***** * 0;

}
answered by (-189 points)
0 like 0 dislike
Hidden content!
#include <iostream>

#include <cstdlib>

using namespace std;

class CTime

{
** ** *** * * *** ** *
**** * * *** * **** * ** ** * * * * * hour,min;
* * * * * * * *** *** **** * * sec;


*** ** **** * * * * *
** * ** * *** * * ** * **** * a, int b,double c){
* *** *** ** ** *** * * ** * * * * * * *
* * *** * ** ** * ****** ** ** *** * * * **
***** *** *** *** ** *** *** * * **** * * *
** * * **** ** * ** **
** ** * * * * * * *** operator>(CTime& t2){
* * * ** ** ** * * ******** ***** * **** s1,s2;
* * * *** ***** ***** * ** ** * *** ** ** ** * * ** * ** *** ** *** * ** *
** * **** ****** * *** * * ***** * * **** ** * * *********
** *** ** ** * *** * ** **** * * ** *
** * * ** * ** * ********* * **** ** * *** *** * *** * ** * * 1;
*** ** * * * *** * *** * * * * **
**** ** * **** * * * **** * ***** *** * ** * ** ** * ** * 0;
** ** * *** *** * * **** *
** ** ** ** ** * ** * **** operator<(CTime& t2){
* **** ** ** ** ** *** * *** ** ******* ** *** s1,s2;
** **** *** **** *** * ** * ** * ** * ** * ****** * * * * * * * ** * ******* ***
* * *** * ** ***** ** ** * * * * ** ** ** * ** * * * * **
** ****** * * * *** ** *** * ** * ** * ***
*** ** * * * *** * ** * * * * * * * * * * ** * ** * **** * ** ** * 1;
* ** ** * ** **** * ** *
** *** * *** * **** ************ ******* * * ** * **** * * ** * * *** * 0;
* * * * * * * *





};



int main(void)

{
* *** * * * ** ** * t1(4,13,51.3);
* *** * ** ** ** * * t2(5,44,30.3);

   
* * ** * ** *** * ** ***** *
* *** * * * * * * ** *** **** ** << "t1 is larger than t2" << endl;
* ** **** ** ** *
**** * * * * * * **** ** * * * * << "t2 is larger than t1" << endl;


* ** ** * * * * ** ***
* * ** * ***** * * ** *** << "t1 is smaller than t2" << endl;
** ** *** * *** ** *
***** * * *** ** * *** ** * ** **** * << "t2 is smaller than t1" << endl;
* * ********* *
* ** ** ** **** * ***
**** * *** **** *** ** 0;

}
answered by (-384 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.71.254.250
©2016-2024

Related questions

0 like 0 dislike
15 answers
[Exercise] Coding (C) - asked Jun 1, 2017 in C++
ID: 24854 - Available when: Unlimited - Due to: Unlimited
| 512 views
0 like 0 dislike
18 answers
[Exercise] Coding (C) - asked May 25, 2017 in C++
ID: 24828 - Available when: Unlimited - Due to: Unlimited
| 654 views
0 like 0 dislike
17 answers
[Exercise] Coding (C) - asked Jun 1, 2017 in C++
ID: 24855 - Available when: Unlimited - Due to: Unlimited
| 584 views
0 like 0 dislike
30 answers
[Exercise] Coding (C) - asked May 18, 2017 in C++
ID: 24769 - Available when: Unlimited - Due to: Unlimited
| 770 views
12,783 questions
183,443 answers
172,219 comments
4,824 users