Small programs with automatic shutdown in C language, dedicated for the whole person
Interesting little programs for capturing people, suitable for beginners to practice. After you click it on, the computer will automatically shut down after a certain period of time. Enter words like "I am a pig" to end. Otherwise, the shutdown task will remain in the countdown state .. # Include <stdio. h> // function of the standard input/output library # include <stdlib. h> // enter the command # include <string. h> // string. The database function int main () {char a [10] defined in the array; // defines an array of character types, it is easy for players to enter all types of character information from the keyboard. flag: printf ("Please input \" I am pig \ "; otherwise, the computer will be disabled \ n" in one minute "); // The statement "I am a pig" can be freely changed by the setter, but remember to change the system ("shutdown-s-t 60") at the corresponding position "); // 60 seconds countdown shutdown command, the time can be freely changed scanf ("% s", a); // players from the keyboard type string if (strcmp (, "I'm a pig") = 0) {// compare two strings. IF the two strings are equal, execute the statement printf under IF ("Congratulations! You have selected your own Sn and admitted to reality! \ N "); system (" shutdown-a "); // end the automatic shutdown countdown command. Of course, you can also break the rule and cancel this statement, but that would be too evil.} elsegoto flag; // jump to the flag and continue to execute return 0 ;}