Guest User

Untitled

a guest
Aug 20th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.  
  5. int horas,horas1, minutos;
  6. scanf("%d %d", &horas, &minutos);
  7.  
  8. if (horas <= 24 && minutos < 60) {
  9.  
  10. if (horas < 12) {
  11.  
  12. printf("%.2d:%.2d \nam\n", horas, minutos);
  13. }
  14. else if (horas >= 12 && horas <= 23) {
  15.  
  16. printf("%.2d:%.2d \npm", horas-12, minutos);
  17.  
  18. }
  19.  
  20. }
  21.  
  22. if (horas == 24) {
  23. horas=0;
  24. printf("%.2d:%.2d \nam\n", horas, minutos);
  25. }
  26.  
  27.  
  28. return 0;
  29. }
Add Comment
Please, Sign In to add comment