main.cpp

来自「输入关机的时间即可在指定的时间关机」· C++ 代码 · 共 36 行

CPP
36
字号

#include "all.h"
using namespace std;
int main(int argc, char *argv[])
{
    char *shuttime=(char*)malloc(100*sizeof(char));
    char *temp=(char*)malloc(100*sizeof(char));
    int choice;
    while((choice=display1())!=0){
        if(choice==1){
            while(true){
                display2(shuttime);
                temp[0]='\0';
                strcat(temp,shuttime);
                if(execute(shuttime)){
                    printf("\n                              已经设置关机时间为 %s\n\n",temp);
                    stopshut(shuttime);
                    system("pause");
                    break; 
                }
                else{
                    printf("输入有误! ");
                    system("pause");
                }
            }
        } 
        else if(choice==2){
            delall();
            system("pause");
        }
    }
    delete[]shuttime;
    delete[] temp;
    return EXIT_SUCCESS;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?