C结构体编程题

编写一个函数,提示用户输入日、月和年。月份可以是月份号、月份 名或月份名缩写。然后该程序应返回一年中到用户指定日子(包括这一天) 的总天数

#include <stdio.h>
#include <ctype.h>//提供判断是否是字符或数字的头文件
#include <string.h>//提供strcmp函数原型
#include <stdlib.h>//提供atoi函数
struct yearAndMontherAndDays
{
    char* QCOfMonth[12];
    char* SXOfMonth[12];
    int NumOfMonth[12];
    int DaysOfEveryMonth[12];
};
int UserInputIndicator(struct yearAndMontherAndDays * p);
int main()
{
    struct yearAndMontherAndDays Val = {        {"January","February","March","April","May","June","July","August","September","October","November","December"},
{"Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"},
		 {1,2,3,4,5,6,7,8,9,10,11,12},
        {31,28,31,30,31,30,31,30,31,31,30,31}};
    int sum = 0;
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值