鱼C论坛

 找回密码
 立即注册
查看: 2135|回复: 1

输入年、月、日,求这是这年的第几天

[复制链接]
发表于 2016-7-11 20:54:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
编译没错,运行时提示出错


#include<stdio.h>
#include<math.h>
void main()
{
        int a,b,c,d,e;
        print ("请输入某年某月某日");
        scanf("%d,%d,%d",&a,&b,&c);
        if ((a%4==0)&&(a%100!=0))
        {d=29;}
        if ((a%100==0)&&(a%400!=0))
        {d=28;}
        if (a%400==0)
        {d=28;}
        if (a%4!=0)
        {        d=28;}
        e=0;
        switch(b-1)
        {
        case 12:e=e+31;
        case 11:e=e+30;
        case 10:e=e+31;
    case 9:e=e+30;
        case 8:e=e+31;
        case 7:e=e+31;
        case 6:e=e+30;
        case 5:e=e+31;
        case 4:e=e+30;
        case 3:e=e+31;
        case 2:e=e+d;
        case 1:e=e+31;
        }
                e=e+c;
                printf("%d",e);
               
}
// *--------------------Configuration: hh - Win32 Debug--------------------
Linking...
hf.obj : error LNK2005: _main already defined in a.obj
a.obj : error LNK2001: unresolved external symbol _print
hf.obj : error LNK2001: unresolved external symbol _print
Debug/hh.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.

hh.exe - 1 error(s), 0 warning(s)
   *//
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2016-7-13 11:59:43 | 显示全部楼层
  print ("请输入某年某月某日");
这里打错了
  是printf
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-6-15 18:00

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表