Skip to Content

Solution to hw00d

#include <stdio.h>
#include <iostream>
#include <math.h>
 
using namespace std;
 
int main(int argc, char *argv[])
{
    int h,m;
    int min;
    int nm,nh;
    scanf("%d %d",&h,&m);
    scanf("%d",&min);
    nm = (m + min) % 60;
    nh = ( h + (m + min) / 60) ;
    nh = nh % 24;
    printf("%02d %02d\n",nh,nm);
    return EXIT_SUCCESS;
}

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Allowed HTML tags: <pre> <span> <div> <p> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <h4> <hr> <div> <img> <blockquote> <pre> <br> <table> <tr> <td> <th> <thead> <tbody> <object> <param>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
  • LaTex commands embedded in text will be interpreted and rendered. Additional information can be found at DruTex Documentation Pages
    • Provides different environments to create rendered images (especially maths).
    • Line and paragraphs break automatically.
    • Assists automatic numbering of tex, equation, and equations environments.
    • Images can be added to this post.
    • Adds typographic refinements.

    More information about formatting options

    CAPTCHA
    This question is for testing whether you are a human visitor and to prevent automated spam submissions.