fork download
  1. #include <bits/stdc++.h>
  2. #include <iostream>
  3. #include <iomanip>
  4. #include <thread>
  5. #include <chrono>
  6.  
  7. using namespace std;
  8. vector<string> nguphap;
  9. vector<string> transnp;
  10. vector<string> tg;
  11. string A;
  12. vector<pair<string,string>> AB;
  13. vector<string> luu;
  14.  
  15. // ĐỊNH DẠNG THỜI GIAN && VB THEO YÊU CẦU !!!
  16. int main(){
  17.  
  18.  
  19. int StepSizeX, StepSizeY, MaxJumpCount, CurrentJumpCount = 0;
  20. string OutputStringSG;
  21. stringstream StreamBuilderSG;
  22.  
  23. cin >> StepSizeX;
  24. cin >> StepSizeY;
  25. cin >> MaxJumpCount;
  26. for (int CurrentMinutes = 0; CurrentMinutes < 60; ++CurrentMinutes) {
  27. for (int CurrentSeconds = 0; CurrentSeconds < 60; CurrentSeconds += StepSizeX) {
  28. if (CurrentJumpCount >= MaxJumpCount)
  29. break;
  30.  
  31. int CurrentStepSize = (CurrentJumpCount % 2 == 0) ? StepSizeX : StepSizeY;
  32. int NextSeconds = CurrentSeconds + CurrentStepSize;
  33. int NextMinutes = CurrentMinutes;
  34.  
  35. if (NextSeconds >= 60) {
  36. NextSeconds -= 60;
  37. ++NextMinutes;
  38. }
  39.  
  40. StreamBuilderSG << "00:" << setw(2) << setfill('0') << CurrentMinutes << ":"
  41. << setw(2) << setfill('0') << CurrentSeconds << ",000 --> 00:"
  42. << setw(2) << setfill('0') << NextMinutes << ":"
  43. << setw(2) << setfill('0') << NextSeconds << ",000/";
  44.  
  45. for (volatile int DelayCounterSG = 0; DelayCounterSG < 1000000; ++DelayCounterSG);
  46.  
  47. ++CurrentJumpCount;
  48. }
  49. if (CurrentJumpCount >= MaxJumpCount)
  50. break;
  51. }
  52.  
  53. OutputStringSG = StreamBuilderSG.str();
  54.  
  55. A = OutputStringSG;
  56.  
  57. stringstream AA(A);
  58. string tgg;
  59. while(getline(AA , tgg , '/')){
  60. tg.push_back(tgg);
  61. }
  62.  
  63. int x;
  64.  
  65. while(cin >> x){
  66. string s;
  67. getline(cin, s);
  68. stringstream ss(s);
  69. string word;
  70. int i = 1;
  71.  
  72. while(getline (ss , word , '.')){
  73. if(i==2){
  74. nguphap.push_back(word);
  75. }
  76. else if(i==3){
  77. transnp.push_back(word);
  78. }
  79. i++;
  80. }
  81. i=1;
  82. }
  83.  
  84. int cnt = 0;
  85.  
  86. for(int l = 0;l<transnp.size();l++){
  87. AB.push_back({nguphap[l],transnp[l]});
  88. }
  89. int K = 2;
  90. for(auto k : AB){
  91. for(int j = 1;j<=K;j++){
  92. luu.push_back(k.first);
  93. luu.push_back(k.second);
  94. }
  95. }
  96.  
  97. for(auto k : luu){
  98. cout << cnt + 1 << endl << endl;
  99. cout << tg[cnt] << endl;
  100. cout << endl;
  101. cout << k << endl;
  102. cout << endl;
  103. cnt++;
  104. }
  105. return 0;
  106. }
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
Standard output is empty