1106:0 start-up algorithm 13--find the number of minutes between 2 time

Source: Internet
Author: User

1106:0 start-up algorithm 13--2 minutes between time limit:1 Sec Memory limit:64 MB 64bit IO Format:%lld
submitted:4320 accepted:1602
[Submit] [Status] [Web Board] Description

Water problem

Input

Enter 2 lines, which are 2 times, between hours and minutes: separated (Subject contains multiple sets of test data)

Output

Number of minutes between outputs (one row per group of test data)

Sample Input
12:1212:16

Sample Output
3

HINT

For simplicity's sake, assume that these 2 times are smaller on the same day and in front of them.


Source

0 Starting point Learning algorithm

1#include <stdio.h>2 intMain () {3     inth1,m1,h2,m2;4      while(SCANF ("%d:%d%d:%d", &h1,&m1,&h2,&m2)! =EOF) {5printf"%d\n", (H2-H1) * -+ (m2-m1-1));6     }7     return 0;8}

The number of hours must be counted.

1106:0 start-up algorithm 13--the number of minutes between 2 times

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.