Created
June 15, 2015 08:32
-
-
Save feis/1ff45ffdd71c0d3a0849 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int getID(int Fpass, int Fstop) { | |
const int i = Fpass / 60; | |
return (19 - i) * i / 2 + (Fstop - Fpass) / 60 - 1; | |
} | |
int main() { | |
int Fpass, Fstop; | |
const int begin = 0; | |
const int end = 540; | |
const int step = 60; | |
for (Fpass = begin; Fpass <= end; Fpass += step) { | |
for (Fstop = Fpass + step; Fstop <= end; Fstop += step) { | |
printf("%d %d %d\n", Fpass, Fstop, getID(Fpass, Fstop)); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment