From 80c67be8bab3906832bf3a218698c9d8be9722c9 Mon Sep 17 00:00:00 2001 From: p2jvg4k7s <274055206@qq.com> Date: Wed, 26 Jun 2024 10:05:52 +0800 Subject: [PATCH] Add 1.cpp --- 1.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 1.cpp diff --git a/1.cpp b/1.cpp new file mode 100644 index 0000000..177e22c --- /dev/null +++ b/1.cpp @@ -0,0 +1,27 @@ +#include +using namespace std; +class Time +{ +public: + void setTime(); + void showTime(); + int hour, minute, sec; +}; + +void fun(Time &t) +{ t.hour=23; } + +void Time::setTime() +{ cin>>hour>>minute>>sec; } + +void Time::showTime() +{ cout<