renamed C folder

This commit is contained in:
anon
2024-07-22 19:37:02 +02:00
parent 6aa339a50d
commit d978a20df8
87 changed files with 0 additions and 0 deletions

20
C_C++/current_year.cpp Normal file
View File

@ -0,0 +1,20 @@
// @COMPILECMD g++ $@
#include <iostream>
#include <chrono>
#include <ctime>
int main() {
// Get the current system time
std::time_t currentTime = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
// Convert the time to a local time
std::tm* localTime = std::localtime(&currentTime);
// Extract the year from the local time
int currentYear = localTime->tm_year + 1900;
// Display the current year
std::cout << "Current year: " << currentYear << std::endl;
return 0;
}