Red de conocimiento informático - Problemas con los teléfonos móviles - Planificación del tiempo

Planificación del tiempo

¿clase? Hora

{

Privada:

int? h;

int? m;

int? s;

Público:

TIEMPO(){ };

~ TIEMPO(){ }; , int? m, int? s)

{

Esto->h? =?h;

Esto->m? =?m;

Esto->s? =?s;

}

¿No es válido? add_s(int?s)

{

Esto->s? =?Esto->s? +?s;

}

¿Nulo? set(int?h, int?m, int?s)

{

if (h & gt23?||?h?& lt?0)

{

¿Volver? ;

}

Si (m & gt60?||?m?& lt?0)

{

¿Devolver? ;

}

if(s & gt;60?||?s?<?0)

{

¿Regresión? ;

}

Esto->h? =?h;

Esto->m? =?m;

Esto->s? =?s;

}

¿No es válido? Imprimir()

{

printf("%02d:%02d:%02d ", h, m, s

}

);

};Es fácil de implementar, es mejor ajustarlo usted mismo.