Hi, I wanna ask about what should I do next to solve this case ?
This is my code that I have made:
Code:
#include <stdio.h>#include <stdlib.h>
#include <unistd.h>
int main()
{
int h,m;
int D = 1000;
int numTestCases;
scanf("%d",&numTestCases);
for ( int i = 1 ; i <= numTestCases ; i++ ) {
printf("Case #%d:\n", i);
scanf("%d %d",&h,&m);
if (h > 12){
printf("Error!\n"); exit(0);
}
if (m > 60){
printf("Error!\n"); exit(0);
}while(1)
{
if(h > 12){
h = 1; m = 0;
}
if(m > 59){
h +=1; m=0;
}
printf("\n%02d:%02d",h,m);
sleep(D);
system("cls");
}
}
}
is there anything that I can add ?