c語言順序表

你輸入的括弧是漢字括弧,應該改為英語括弧。比較:
漢字:()
英語:()

⑵ 怎麼用c語言 編一個時間表 源代碼是什麼_

用到的數據結構:
time_t是一個long類型 代表機器時間,可由time( )函數獲得。

日歷時間用一個(char *) 類型的字元串表示。格式為:星期 月 日 小時:分:秒 年\n\0
可由函數ctime( ) asctime( ) 得到。

以tm結構表達的時間,結構tm定義如下:
struct tm { 可由函數localtime( ), gmtime( )得到
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst; };
//系統日期
struct date {
int da_year; /* Year - 1980 */
char da_day; /* Day of the month */
char da_mon; /* Month (1 = Jan) */ };
//系統時間
struct time {
unsigned char ti_min; /* Minutes */
unsigned char ti_hour; /* Hours */
unsigned char ti_hund; /* Hundredths of seconds */
unsigned char ti_sec; /* Seconds */ };

用到的函數:
char * asctime(struct tm * ptr) 將tm結構的時間轉化為日歷時間。
char *ctime(long time) 將機器時間轉化為日歷時間。
struct tm *gmtime(time_t *time) 將機器時間轉化為tm時間

當ptr為空時,得到機器時間;非空時,設置機器時間。
time_t time(time_t *ptr) 得到或設置機器時間
double difftime(time_t time2, time_t time1) 得到兩次機器時間差,單位為秒

long dostounix(struct data *d, struct time *t) 將DOS的日期和時間格式轉換成UNIX標准
(機器時間(用到dos.h庫).void unixtodos(long utime, struct date *d, struct time *t)
將UNIX格式的時間和日期轉換成DOS格式(由time 和date兩部分組成,只能由機器時間得到,並且用到dos.h庫)
void getdate(struct date *d) 得到系統日期,d 存放得到的日期信息
void setdate(struct date *d)
void gettime(struct date *t) 得到系統時間 d 存放得到的時間信息
void settime(struct date *t)

C語言的標准庫函數包括一系列日期和時間處理函數,它們都在頭文件中說明。下面列出了這些函數。
在頭文件中定義了三種類型:time_t,struct tm和clock_t。

在中說明的C語言時間函數

time_t time(time_t *timer);

double difftime(time_t time1,time_t time2);

struct tm *gmtime(const time_t *timer);

struct tm *localtime(const time_t *timer);

char *asctime(const struct tm *timeptr);

char *ctime(const time_t *timer);

size_t strftime(char *s,size_t maxsize,const char *format,const struct tm *timeptr);

time_t mktime(struct tm *timeptr);

clock_t clock(void);

下面是我從網上收集到的時間函數集
asctime(將時間和日期以字元串格式表示)
相關函數
time,ctime,gmtime,localtime
表頭文件
#i nclude
定義函數
char * asctime(const struct tm * timeptr);
函數說明
asctime()將參數timeptr所指的tm結構中的信息轉換成真實世界所使用的時間日期表示方法,然後將結果以字元串形態返回。
此函數已經由時區轉換成當地時間,字元串格式為:"Wed Jun 30 21:49:08 1993\n"
返回值
若再調用相關的時間日期函數,此字元串可能會被破壞。此函數與ctime不同處在於傳入的參數是不同的結構。
附加說明
返回一字元串表示目前當地的時間日期。
範例
#i nclude
main()
{
time_t timep;
time (&timep);
printf("%s",asctime(gmtime(&timep)));
}
執行
Sat Oct 28 02:10:06 2000

ctime(將時間和日期以字元串格式表示)
相關函數
time,asctime,gmtime,localtime
表頭文件
#i nclude
定義函數
char *ctime(const time_t *timep);
函數說明
ctime ()將參數timep所指的time_t結構中的信息轉換成真實世界所使用的時間日期表示方法,然後將結果以字元串形態返回。
此函數已經由時區轉換成當地時間,字元串格式為"Wed Jun 30 21 :49 :08 1993\n"。若再調用相關的時間日期函數,此字元串可能會被破壞。
返回值
返回一字元串表示目前當地的時間日期。
範例
#i nclude
main()
{
time_t timep;
time (&timep);
printf("%s",ctime(&timep));
}
執行
Sat Oct 28 10 : 12 : 05 2000

gettimeofday(取得目前的時間)
相關函數
time,ctime,ftime,settimeofday
表頭文件
#i nclude
#i nclude
定義函數
int gettimeofday ( struct timeval * tv , struct timezone * tz )
函數說明
gettimeofday()會把目前的時間有tv所指的結構返回,當地時區的信息則放到tz所指的結構中。
timeval結構定義為:
struct timeval{
long tv_sec; /*秒*/
long tv_usec; /*微秒*/
};
timezone 結構定義為:
struct timezone{
int tz_minuteswest; /*和Greenwich 時間差了多少分鍾*/
int tz_dsttime; /*日光節約時間的狀態*/
};
上述兩個結構都定義在/usr/include/sys/time.h。tz_dsttime 所代表的狀態如下
DST_NONE /*不使用*/
DST_USA /*美國*/
DST_AUST /*澳洲*/
DST_WET /*西歐*/
DST_MET /*中歐*/
DST_EET /*東歐*/
DST_CAN /*加拿大*/
DST_GB /*大不列顛*/
DST_RUM /*羅馬尼亞*/
DST_TUR /*土耳其*/
DST_AUSTALT /*澳洲(1986年以後)*/
返回值
成功則返回0,失敗返回-1,錯誤代碼存於errno。附加說明EFAULT指針tv和tz所指的內存空間超出存取許可權。
範例
#i nclude
#i nclude
main(){
struct timeval tv;
struct timezone tz;
gettimeofday (&tv , &tz);
printf("tv_sec; %d\n", tv,.tv_sec) ;
printf("tv_usec; %d\n",tv.tv_usec);
printf("tz_minuteswest; %d\n", tz.tz_minuteswest);
printf("tz_dsttime, %d\n",tz.tz_dsttime);
}
執行
tv_sec: 974857339
tv_usec:136996
tz_minuteswest:-540
tz_dsttime:0

gmtime(取得目前時間和日期)
相關函數
time,asctime,ctime,localtime
表頭文件
#i nclude
定義函數
struct tm*gmtime(const time_t*timep);
函數說明
gmtime()將參數timep 所指的time_t 結構中的信息轉換成真實世界所使用的時間日期表示方法,然後將結果由結構tm返回。
結構tm的定義為
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
};
int tm_sec 代表目前秒數,正常范圍為0-59,但允許至61秒
int tm_min 代表目前分數,范圍0-59
int tm_hour 從午夜算起的時數,范圍為0-23
int tm_mday 目前月份的日數,范圍01-31
int tm_mon 代表目前月份,從一月算起,范圍從0-11
int tm_year 從1900 年算起至今的年數
int tm_wday 一星期的日數,從星期一算起,范圍為0-6
int tm_yday 從今年1月1日算起至今的天數,范圍為0-365
int tm_isdst 日光節約時間的旗標
此函數返回的時間日期未經時區轉換,而是UTC時間。
返回值
返回結構tm代表目前UTC 時間
範例
#i nclude
main(){
char *wday[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
time_t timep;
struct tm *p;
time(&timep);
p=gmtime(&timep);
printf("%d%d%d",(1900+p->tm_year), (1+p->tm_mon),p->tm_mday);
printf("%s%d;%d;%d\n", wday[p->tm_wday], p->tm_hour, p->tm_min, p->tm_sec);
}
執行
2000/10/28 Sat 8:15:38

localtime(取得當地目前時間和日期)
相關函數
time, asctime, ctime, gmtime
表頭文件
#i nclude
定義函數
struct tm *localtime(const time_t * timep);
函數說明
localtime()將參數timep所指的time_t結構中的信息轉換成真實世界所使用的時間日期表示方法,然後將結果由結構tm返回。
結構tm的定義請參考gmtime()。此函
數返回的時間日期已經轉換成當地時區。
返回值
返回結構tm代表目前的當地時間。
範例
#i nclude
main(){
char *wday[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
time_t timep;
struct tm *p;
time(&timep);
p=localtime(&timep); /*取得當地時間*/
printf ("%d%d%d ", (1900+p->tm_year),( l+p->tm_mon), p->tm_mday);
printf("%s%d:%d:%d\n", wday[p->tm_wday],p->tm_hour, p->tm_min, p->tm_sec);
}
執行
2000/10/28 Sat 11:12:22

mktime(將時間結構數據轉換成經過的秒數)
相關函數
time,asctime,gmtime,localtime
表頭文件
#i nclude
定義函數
time_t mktime(strcut tm * timeptr);
函數說明
mktime()用來將參數timeptr所指的tm結構數據轉換成從公元1970年1月1日0時0分0 秒算起至今的UTC時間所經過的秒數。
返回值
返回經過的秒數。
範例
/* 用time()取得時間(秒數),利用localtime()
轉換成struct tm 再利用mktine()將struct tm轉換成原來的秒數*/
#i nclude
main()
{
time_t timep;
strcut tm *p;
time(&timep);
printf("time() : %d \n",timep);
p=localtime(&timep);
timep = mktime(p);
printf("time()->localtime()->mktime():%d\n",timep);
}
執行
time():974943297
time()->localtime()->mktime():974943297

settimeofday(設置目前時間)
相關函數
time,ctime,ftime,gettimeofday
表頭文件
#i nclude
#i nclude
定義函數
int settimeofday ( const struct timeval *tv,const struct timezone *tz);
函數說明
settimeofday()會把目前時間設成由tv所指的結構信息,當地時區信息則設成tz所指的結構。詳細的說明請參考gettimeofday()。
注意,只有root許可權才能使用此函數修改時間。
返回值
成功則返回0,失敗返回-1,錯誤代碼存於errno。
錯誤代碼
EPERM 並非由root許可權調用settimeofday(),許可權不夠。
EINVAL 時區或某個數據是不正確的,無法正確設置時間。

time(取得目前的時間)
相關函數
ctime,ftime,gettimeofday
表頭文件
#i nclude
定義函數
time_t time(time_t *t);
函數說明
此函數會返回從公元1970年1月1日的UTC時間從0時0分0秒算起到現在所經過的秒數。如果t 並非空指針的話,
此函數也會將返回值存到t指針所指的內存。
返回值
成功則返回秒數,失敗則返回((time_t)-1)值,錯誤原因存於errno中。

⑶ c語言中參數表是什麼意思

多個參數,安順序排列 叫 參數表。

參數1,參數2,參數3,參數4,參數5,。。。參數n
共 1 到 n 個。

printf("*****"\n");-- 沒有輸出參數,沒有 輸出參數表。
printf("%d %d"\n",a,b);-- a,b 兩個參數,參數表就是 a,b.
printf("%d %d %d"\n",a,b,c);-- a,b,c 3個參數,參數表就是 a,b,c

⑷ C語言查表

表就是自己做的.
舉個簡單的例子,根據公式計算後,0-100對應100度,那就直接根據AD值去對應溫度

⑸ c語言編寫鍾表的問題

#include<graphics.h>
#include<math.h>
#include<dos.h>

#define PI 3.1415926
#define x0 320 /*定義鍾表中心坐標*/
#define y0 240

void DrawClock(int x,int y,int color) /*畫表盤*/
{ int r=150; /*表盤的半徑*/
float th;
setcolor(color);
circle(x,y,r);
circle(x,y,2);
}

void DrawHand(int x,int y,float th,int l,int color)
{
int x1,y1;
x1=x l*sin(th);
y1=y-l*cos(th);
setcolor(color);
line(x,y,x1,y1);
}

void main()
{int gdriver=DETECT,gmode;
struct time curtime;
float th_hour,th_min,th_sec;
initgraph(&gdriver,&gmode,"");

setbkcolor(0);

while(! kbhit())
{
DrawClock(x0,y0,14);
gettime(&curtime); /*得到當前系統時間*/

gotoxy(35,20); /*定位輸出位置*/
if((float)curtime.ti_hour<=12) /*午前的處理*/
{printf("AM ");
if((float)curtime.ti_hour<10) printf("0"); /*十點之前在小時數前加零*/
printf("%.0f:",(float)curtime.ti_hour);
}
else /*午後的處理*/
{printf("PM ");
if((float)curtime.ti_hour-12<10) printf("0");
printf("%.0f:",(float)curtime.ti_hour-12);
}

if((float)curtime.ti_min<10) printf("0");
printf("%.0f:",(float)curtime.ti_min);
if((float)curtime.ti_sec<10) printf("0");
printf("%.0f",(float)curtime.ti_sec);

/*以下三行計算表針轉動角度,以豎直向上為起點,順時針為正*/

th_sec=(float)curtime.ti_sec*0.1047197551; /*2π/60=0.1047197551*/
th_min=(float)curtime.ti_min*0.1047197551 th_sec/60.0;
th_hour=(float)curtime.ti_hour*0.523598775 th_min/12.0; /* 2π/12=0.5235987755 */
DrawHand(x0,y0,th_hour,70,2); /*畫時針*/
DrawHand(x0,y0,th_min,110,3); /*分針*/
DrawHand(x0,y0,th_sec,140,12); /*秒針*/

sleep(1); /*延時一秒後刷新*/
cleardevice();
}

closegraph();
}

能正常運行,我測試過
來自網路轉載

⑹ 用C語言程序運行出一個鍾表 要求切身時間過得

你要給哥加分啊。。。這可視個高難度的 花了哥一個小時 首先我的聲明 1.這是用windows api寫的程序。所以要求是純c的話就沒有辦法了 2.其中定時用了兩種方法。一種是用取消息。另一種是延時隊列。這里只使用了取消息的方法。延時隊列由於我機器上是vc6.0,CreateTimerQueue在本人機器上無法使用,需要新的sdk,所以沒有加以驗證,但取消息的方式是可行的。 3.稍稍驗證了下,基本滿足要求。 ------------------------------------------- 程序如下: // DigitalClock.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <windows.h> #include <winbase.h> typedef struct _st_time{ int hour; int min; int sec; }ST_TIME; ST_TIME g_Time; // The struct contain the hour,min and sec. HANDLE g_hStdout; // WORD g_cxCenter, g_cyCenter; // Center of the screen. HANDLE g_DoneEvent; // The program could be over. BOOL g_ThreadTerminated; // The Thread should be terminated. #define SECOND_CIRCLE 60 #define MINUTE_CIRCLE 60 #define HOUR_CIRCLE 24 void TimeIncreaseSecond(ST_TIME & st) { st.sec ++; if (st.sec >= SECOND_CIRCLE) { st.sec -= SECOND_CIRCLE; st.min++; if (st.min >= MINUTE_CIRCLE) { st.min -= MINUTE_CIRCLE; st.hour++; if (st.hour >= HOUR_CIRCLE) { st.hour -= HOUR_CIRCLE; } } } } void PrintTimeToScreen(HANDLE hStdout, short cxCenter, short cyCenter, ST_TIME st) { char buf[64] = {0}; COORD crdPos; // make it format to output. sprintf (buf, "%02d:%02d:%02d", st.hour, st.min, st.sec); crdPos.X = cxCenter - 4; crdPos.Y = cyCenter; SetConsoleCursorPosition(hStdout, crdPos); printf(buf); } #ifdef USE_TIMERQUEUE // if we use the timer queue function. // Its procre is in this. void CALLBACK TimerRoutine (LPVOID lpParam, BOOL TimerOrWaitFired) { if (lpParam == NULL) { printf ("NULL parameters.\n"); } else { ST_TIME *st = (ST_TIME *)lpParam; TimeIncreaseSecond(st); PrintTimeToScreen(g_hStdout, g_cxCenter, g_cyCenter, *st); } } #else DWORD WINAPI TimerThreadProc(LPVOID lpParam) { #define ID_TIMER_SECOND 1 MSG msg; BOOL ret; ST_TIME *st = (ST_TIME *)lpParam; SetTimer(NULL, ID_TIMER_SECOND, 1000, NULL); PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); while (!g_ThreadTerminated && (ret = GetMessage (&msg, NULL, 0, 0)) != 0) { if (ret == -1) { //process fatal event. } else if (msg.message == WM_TIMER) { TimeIncreaseSecond(*st); PrintTimeToScreen(g_hStdout, g_cxCenter, g_cyCenter, *st); } else { TranslateMessage (&msg); DispatchMessage (&msg); } } return 1; } #endif // If the ctrl+break combined key pressed. call this function. // It set the g_DoneEvent. this terminate the program. BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) { switch (fdwCtrlType) { case CTRL_BREAK_EVENT: // Terminate the program. printf ("Terminate.\n"); SetEvent(g_DoneEvent); return TRUE; default: return FALSE; } } BOOL InitApplication() { // Get the stdin and stdout handle. HANDLE hStdIn; hStdIn = GetStdHandle(STD_INPUT_HANDLE); if (hStdIn == INVALID_HANDLE_VALUE) return FALSE; g_hStdout = GetStdHandle(STD_OUTPUT_HANDLE); // Set the mode, make the input echo. DWORD fOldMode; GetConsoleMode(hStdIn, &fOldMode); fOldMode |= ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT; SetConsoleMode(hStdIn, fOldMode); // Set the window buffer. // make a line 40 columns. CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(g_hStdout, &csbiInfo); csbiInfo.srWindow.Right = 40; // get the center point. g_cxCenter = csbiInfo.srWindow.Right / 2; g_cyCenter = csbiInfo.srWindow.Bottom / 2; // Set the window. SetConsoleWindowInfo(g_hStdout, TRUE, &csbiInfo.srWindow); return TRUE; } BOOL (HANDLE hStdout, WORD cxCenter, WORD cyCenter, ST_TIME & time) { #define GAPS_LEFT_COLON (-2) #define GAPS_RIGHT_COLON (1) #define GAPS_LEFT_UNDERLINE_START (-4) #define GAPS_MIDDLE_UNDERLINE_START (-1) #define GAPS_RIGHT_UNDERLINE_START (2) // __:__:__ // So the left ":" center -2 // so the right ":" center + 1 // so the left "_" center - 4; // so the lfet "_" center - 1; // so the right "_" center + 2; COORD crdPos; crdPos.X = cxCenter + GAPS_LEFT_COLON; crdPos.Y = cyCenter; SetConsoleCursorPosition(hStdout, crdPos); printf (":"); crdPos.X = cxCenter + GAPS_RIGHT_COLON; SetConsoleCursorPosition(hStdout, crdPos); printf (":"); crdPos.X = cxCenter + GAPS_LEFT_UNDERLINE_START; SetConsoleCursorPosition(hStdout, crdPos); scanf ("%d", &time.hour); crdPos.X = cxCenter + GAPS_MIDDLE_UNDERLINE_START; SetConsoleCursorPosition(hStdout, crdPos); scanf ("%d", &time.min); crdPos.X = cxCenter + GAPS_RIGHT_UNDERLINE_START; SetConsoleCursorPosition(hStdout, crdPos); scanf ("%d", &time.sec); if (time.hour < 0 || time.hour > HOUR_CIRCLE || time.min < 0 || time.min > MINUTE_CIRCLE || time.sec < 0 || time.sec > SECOND_CIRCLE) return FALSE; return TRUE; } int main(int argc, char* argv[]) { InitApplication(); (g_hStdout, g_cxCenter, g_cyCenter, g_Time); // create a event to tell the program to terminate. g_DoneEvent = CreateEvent(NULL, TRUE, FALSE, NULL); #ifdef USE_TIMERQUEUE HANDLE hTimerQueue, hTimer; hTimerQueue = CreateTimerQueue(); if (!CreateTimerQueueTimer(&hTimer, hTimerQueue, TimerRoutine, &g_Time, 1000, 0, 0)) { printf("CreateTimerQueueTimer failed (%d)\\n", GetLastError()); return 3; } #else // create the thread. HANDLE hThreadTimer; DWORD dwThreadId; g_ThreadTerminated = FALSE; hThreadTimer = CreateThread(NULL, 0, TimerThreadProc, &g_Time, 0, &dwThreadId); if (hThreadTimer == NULL) { } #endif SetConsoleCtrlHandler(CtrlHandler, TRUE); if (WaitForSingleObject(g_DoneEvent, INFINITE) != WAIT_OBJECT_0) printf("WaitForSingleObject failed (%d)\\n", GetLastError()); #ifdef USE_TIMERQUEUE if (!DeleteTimerQueue(hTimerQueue)) printf("DeleteTimerQueue failed(%d) \\n", GetLastError()); #else g_ThreadTerminated = TRUE; if (WaitForSingleObject(hThreadTimer, INFINITE) != WAIT_OBJECT_0) printf("WaitForSingleObject failed (%d)\\n", GetLastError()); #endif return 0; } -------------------------------------------- 下面是純c的。 有幾個問題: 1.textmode函數在turboc中沒有辦法使用,不知道是什麼問題,而borland c就可以。 2.無論怎麼設置,自己的ctrlbreak函數在上述兩個環境中都不能被調用,非常遺憾。所以不能夠優雅的退出。只能按兩次ctrlbreak。 下面是程序。 ------------------------------------------ #include <stdio.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <dos.h> #define ABORT 0 int jump_out_loop = -1; int jump_out(void) { jump_out_loop = 1; printf("Abort ..\n"); return ABORT; } int main(void) { struct text_info ti; int center_x, center_y; int hour, min, sec; char str_out[64] = {0}; clrscr(); /*textmode(BW40);*/ /*textmode在turbo c下設置會出問題*/ gettextinfo(&ti); center_x = ti.winright / 2; center_y = ti.winbottom / 2; gotoxy(center_x - 4, center_y); cprintf(" : : "); gotoxy(center_x - 4, center_y); cscanf("%d", &hour); gotoxy(center_x - 1, center_y); cscanf("%d", &min); gotoxy(center_x + 2, center_y); cscanf("%d", &sec); /* check input valid or not */ {} setcbrk(1); ctrlbrk(jump_out); /*jump_out沒有起到作用,實在不好意思.*/ /* if (getcbrk()) printf("crtl break is on\n"); else printf("is off\n"); */ while (1) { delay(1000); sec++; if (sec >= 60) { sec -= 60; min++; if (min >= 60) { min -= 60; hour++; if (hour >= 24) { hour -= 24; } } } sprintf(str_out, "%02d:%02d:%02d", hour, min, sec); gotoxy(center_x - 4, center_y); cprintf(str_out); } /* getch();*/ return 0; }

⑺ c語言電子毫秒錶計時程序

使用time()函數。它在頭文件time.h中
具體使用方法如下:
time_t
a,b;//time_t是表示時間的結構體,你可以在time.h中找到它的原型。
a=time(null);//表示獲取當前的機器時間。
代碼段
b=time(null);//表示獲取當前的機器時間。
a是代碼段執行前的時間,b是代碼段執行後的時間(單位是秒),那麼b-a當然是代碼段的執行時間了。輸出時,以長整型輸出時間。
希望這個解答可以幫到你。

⑻ c語言怎麼查表

查表是數據結構中的一個概念。查表的前提是先建表。

在C語言實現中,建表也就是將一系版列的數據,或者權有原始數據中提取出的特徵值,存儲到一定的數據結構中,如數組或鏈表中。
查表的時候,就是對數組或鏈表查詢的過程。常用的方式有如下幾種:
1 對於有序數組,可以採用折半查找的方式快速查詢。
2 對於鏈表,可以根據鏈表的構建方式,進行針對性查詢演算法的編寫。
3 大多數情況,可以通過遍歷的方式進行查表。即從第一個元素開始,一直順序查詢到最後一個元素,逐一對比。

⑼ c語言鍾表(這樣為什麼60秒後繼續輸出了)

#include<stdio.h>
#include<windows.h>
intmain()
{inth,m,s;
printf("請輸入當前時間");
scanf("%d:%d:%d",&h,&m,&s);
if(h>24||h<0)return0;
if(m>60||m<0)return0;
system("cls");
for(;;)
{for(;s<60;s++)
{printf("%.2d:%.2d:%.2d",h,m,s);//有修改
Sleep(1000);
system("cls");
}
s=0;//新增
m++;
if(m==60)
{h++;
m=0;
}
if(h==24)
{h=0;
}
}
return0;
}