weixin_45337755 2019-09-11 16:46 采纳率: 0%
浏览 648

杭电oj 2629题目求解惑

杭电oj2629
自己编译运行输出是符合要求的,可是再oj上就是提示输出错误,希望好心人能为我解惑!!!

#include<stdio.h>
#include<string.h>

int main() {
    int n;
    char s[20];

    int place,birthday,garbage;
    int year, month, day;
    scanf("%d", &n);
    while (n--)
    {
        scanf("%6d", &place);
        scanf("%8d", &birthday);
        scanf("%4d", &garbage);

        if (place == 330000)
            strcpy(s,"Zhejiang");
        else if (place == 110000)
            strcpy(s, "Beijing");
        else if (place == 710000)
            strcpy(s, "Taiwan");
        else if (place == 810000)
            strcpy(s, "Hong Kong");
        else if (place == 820000)
            strcpy(s, "Macao");
        else if (place == 540000)
            strcpy(s, "Tibet");
        else if (place == 210000)
            strcpy(s, "Liaoning");
        else if (place == 310000)
            strcpy(s, "Shanghai");

        year = birthday / 10000;
        month = birthday / 100 - year * 100;
        day = birthday % 100;

        printf("He/She is from %s,and his/her birthday is on %d,%d,%d based on the table.\n", s, month, day, year);

    }

    return 0;
}
  • 写回答

1条回答 默认 最新

  • wowpH 2019-09-11 20:13
    关注

    Here is Samuel's ID number 331004198910120036 can you tell where he is from?The first 2 numbers tell that he is from Zhengjiang Province,number 19891012 is his birthday date (yy/mm/dd).

    把这句话好好看看。

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器