Advertisement
Mlack

Laba_num_6

Mar 12th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<conio.h>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. int nav_d_hh, nav_d_mm, trival, kilkist;
  9. printf("Zadayite pochatok navchalnogo dnya(godini): ");
  10. scanf_s("%d", &nav_d_hh);
  11. printf("Zadayite pochatok navchalnogo dnya(minuti): ");
  12. scanf_s("%i", &nav_d_mm);
  13. printf("Zadayite trivalist odnogo uroka(v minutah): ");
  14. scanf_s("%i", &trival);
  15. printf("Zadayte kilkist uriokiv v etot den: ");
  16. scanf_s("%i", &kilkist);
  17.  
  18. printf("%d", nav_d_hh);
  19.     printf(".");
  20. printf("%d ", nav_d_mm);
  21. printf("- ");
  22.     printf("eto 1 urok");
  23. printf("\n");
  24.  
  25.     int i = 1;
  26.     do
  27.     {
  28. nav_d_mm += trival;
  29. if (nav_d_mm>= 60) { nav_d_hh += 1; nav_d_mm -= 60; }
  30. printf("%d", nav_d_hh);
  31. printf(".");
  32. printf("%d ", nav_d_mm);
  33. printf("- ");
  34. printf("eto ");
  35. printf("%d", i+1);
  36. printf("urok\n");
  37.             ++i;
  38.     }
  39.     while (i < kilkist);
  40. getch();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement