Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int horas,horas1, minutos;
- scanf("%d %d", &horas, &minutos);
- if (horas <= 24 && minutos < 60) {
- if (horas < 12) {
- printf("%.2d:%.2d \nam\n", horas, minutos);
- }
- else if (horas >= 12 && horas <= 23) {
- printf("%.2d:%.2d \npm", horas-12, minutos);
- }
- }
- if (horas == 24) {
- horas=0;
- printf("%.2d:%.2d \nam\n", horas, minutos);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment