Simple birthday dictionary Program

Source: Internet
Author: User

# Include "stdio. H"
# Include "stdlib. H"

Main (INT argc, char * argv [])
{
File * fp_dic;
Int year;
Int month;
Int Day;

Printf ("************************************* * *************************/N ");
Printf ("NOTE: This is the program that generates a simple birthday dictionary/N ");
Printf ("Author: ameihong/N ");
Printf ("unit: Information Security Major of Sichuan Normal University/N ");
Printf ("Contact: QQ 18184412 e-mail anmeihong@sina.com/N ");
Printf ("************************************* * *************************/N ");
If (argc! = 2)
{
Printf ("Usage: [file name] [dictionary path]/n ");
Printf ("Example: dic c: // dic.txt/N ");
} // Whether the input parameters are correct
 
If (fp_dic = fopen (argv [1], "W") = NULL)
{
Printf ("An error occurred while creating the dictionary file! Exit/N ");
Exit (0 );
}
For (year = 1980; year <1991; year ++) // year can be changed to the date you want
For (month = 1; month <13; month ++) // month
For (Day = 1; day <32; day ++) // day
{
Fprintf (fp_dic, "% d/N", year, month, day );
} // Save the generated dictionary
Fclose (fp_dic );
Printf ("the dictionary is successfully generated and saved to the file % S. Thank you for using it! /N ", argv [1]);
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.