| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 324 人关注过本帖
标题:求各位大大指点我一下
只看楼主 加入收藏
落花寂祭
Rank: 1
来 自:南京
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-10-23
结帖率:100%
收藏
已结贴  问题点数:10 回复次数:3 
求各位大大指点我一下
    #include <stdio.h>
#include <stdlib.h>
int main (void)
{
    int year = 0;
    int month = 0;
    int day = 0;
    scanf ("%d\n",&year);
    scanf ("%d\n",&month);
    if ( month >12 || month <1 )
    {
        printf ("this month is nothingness ,input again !");
      if (day >31 || day <1)
    printf ("your error !");
    }
    if (day >31 || day <1)
    {
        day = 32;
    switch (day)
    {
    case 1 : case 21 : case 31:
        printf ("today is %dst %d %d",day,month,year);
        break;
    case 2: case 22:
        printf("today is %dnd %d %d",day,month,year);
        break;
    case 3: case 23:
        printf ("today is %drd %d %d",day,month,year);
        break;
    case 32:
        printf ("your error !");
        break;
    default :
        printf ("today is %dth %d %d",day,month,year);
        break;
    }
    }
    system ("pause");
    return 0;
}
求各位大大帮我看看我这段写的还有问题。还有求各位大大指点一下怎么在最后的输出中将数字月份的输出编程英文月份的描述,需要怎么操作?
搜索更多相关主题的帖子: include 
2013-10-25 20:35
qunxingw
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:贵宾
威 望:24
帖 子:1676
专家分:7295
注 册:2011-6-30
收藏
得分:10 
大概是这个意思吧
程序代码:
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
    int year = 0;
    int month = 0;
    int day = 0;
    scanf ("%d",&year);///
    scanf ("%d",&month);//
    if ( month >12 || month <1 )
    {
        printf ("this month is nothingness ,input again !");
       
    }
    else{
       
        scanf ("%d",&day);
        if (day >31 || day <1)
            printf ("your day error !");
        else
        {
           
            printf ("today is %dst %d %d\n",day,month,year);
           
           
        }
   
}

 system ("pause");
return 0;
}

www.qunxingw.wang
2013-10-25 21:56
落花寂祭
Rank: 1
来 自:南京
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-10-23
收藏
得分:0 
回复 2楼 qunxingw
我是希望您能帮我看一下我写的代码是不是有问题及能不能指点我一下我后面问的那个问题,谢谢,希望您能指导我一下
2013-10-28 22:08
a2403044721
Rank: 1
等 级:新手上路
帖 子:4
专家分:7
注 册:2013-10-27
收藏
得分:0 
int main(void)是什么意思
主函数不是int main()吗
运行你这个程序需要输入3个数,但我就看见俩个,第三个在那
swich后的()是选项,如果是case1,()的值里就是1。
2013-10-28 22:47
快速回复:求各位大大指点我一下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014978 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved