repl.it
@tomnagel/

Random C++ programs

C++

No description

fork
loading
Files
  • main.cpp
  • main
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <ctime>
#include <fstream>

int main(){
  std::cout << "Enter a time:";
  int extra_time;
  std::cin >> extra_time;
  const int begin_time = std::time(nullptr) + extra_time;
  int oldtime = std::time(nullptr);
  while(begin_time > std::time(nullptr)){
    if(oldtime < std::time(nullptr)){
      std::cout << begin_time << "\n" << std::time(nullptr) << "\n";
      oldtime = oldtime + 1;
    }
    
  }
}
Fetching token
?