Advertisement
StoneHaos

415

Oct 29th, 2019
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. //415
  2. #include <cstdio>
  3.  
  4. int main(void) {
  5.     FILE* fin = fopen("input.txt", "r");
  6.     FILE* fout = fopen("output.txt", "w");
  7.  
  8.     int p, sh, f;
  9.     fscanf(fin, "%d", &p);
  10.     fclose(fin);
  11.     f = p / 240;
  12.     p -= f * 240;
  13.     sh = p / 12;
  14.     p -= sh * 12;
  15.     fprintf(fout, "%d %d %d\n", f, sh, p);
  16.     fclose(fout);
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement