Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Khai bao ham thu vien neu co
- #include<stdio.h>
- #include<conio.h>
- // chuong trinh chinh
- void main()
- {
- int h,m,s;
- scanf("%d%d%d",&h,&m,&s);
- if((h>=0 && h<24) && (m>=0 && m<60) &&(s>=0 && s<60))
- {
- if(s<59)
- s++;
- else
- {
- if(m<59)
- {
- m++;s=0;
- }
- else
- {
- if(h<23)
- {
- h++;
- m=0;
- s=0;
- }
- else
- {
- h=0;m=0;s=0;
- }
- }
- }
- printf("%d %d %d",h,m,s);
- }
- else
- {
- printf("0");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement