Simple birthday dictionary program

xiaoxiao2021-03-06  108

#include "stdio.h" #include "stdlib.h"

Main (int Argc, char * argv []) {file * fp_dic; int year; int month; int

PRINTF ("***************************************************** **************** / n "); printf (" Description: this is a simple program to generate birthday dictionary / n "); printf (" author: An Meihong / n ") Printf ("unit: Sichuan Normal University Information Security Professional / N"); Printf ("Contact: QQ 18184412 Email Anmeihong@sina.com / N"); Printf ("************ *********************************************************** * / n "); if (argc! = 2) {Printf (" Usage: [File Name] [Dictionary Path] / N "); Printf (" for, for example: DIC C: //dic.txt/N "); } // Input parameter is correct if IF ((fp_dic = fopen (argv [1], "w"))) == null) {printf ("Built Dictionary file error! Exit / n"); exit (0);} for (Year = 1980; Year <1991; Year ) // Year can change to the date for you want (Month = 1; Month <13; Month ) // Month for (day = 1; day <32; day ) // days {fprintf (fp_dic, "% D% D% D / N", Year, Month, day);} // save the generated dictionary (fp_dic); Printf ("Dictionary successfully, and saved to file In% s, thank you! / n ", argv [1]);

转载请注明原文地址:https://www.9cbs.com/read-101168.html

New Post(0)