이렇게 해도 컴퓨터에 무리가 안갈까요?
초코초코해
#includestdio.h
#includewindows.h
double a, b, c = 0;
void time_set();
void time_delay();
int main()
{
while(1)
{
system(cls);
puts(\n\n\t\t종료할 시간의 단위를 정하세요.);
puts(\n\n\t\t1. 시\t2. 분\t3. 초);
printf(\n\n\t\t입력);
scanf(%lf, &a);
fflush(stdin);
if( a == 1)
{
time_set();
b = b*3600;
time_delay();
}
else if( a == 2 )
{
time_set();
b = b*60;
time_delay();
}
else if( a == 3 )
{
time_set();
b = b*1;
time_delay();
}
else
{
}
}
return 1;
}
void time_set()
{
system(cls);
puts(\n\n\t\t시간을 입력하세요.);
puts(\n\n\t\t[2시간 30분 입력시에는 2.5입력]);
puts(\t\t[2분 15초 입력시에는 2.25입력]);
printf(\n\n\t\t입력);
scanf(%lf, &b);
fflush(stdin);
return;
}
void time_delay()
{
for( c=b;c0;c-- )
{
system(cls);
printf(\n\n\n\n\t\t\t\t%lf, c);
sleep(995);
}
system(shutdown -s -t 00);
}제가 만든타이머 소스 인데요...
작동은 잘되네요... ㅎㅎ이렇게 맨날 컴퓨터를 끄고 싶은데,
매일 이런식으로 종료하면 컴퓨터에 무리가 될까요?
-
한란
시작 메뉴에 있는 비쥬얼한 버튼도 shutdown 명령어를 쓸걸요..