标题:基础的两道编程题,求助大神
取消只看楼主
wyydgq
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2017-2-22
结帖率:0
已结贴  问题点数:20 回复次数:0 
基础的两道编程题,求助大神

#include<stdio.h>
int a,b,c;
int main(){
    void team(int a,int b,int c);
    int A,B,C;
    printf("enter your number:");
    scanf("%d",&C);
    a=C%10;
    b=(C/10)%10;
    c=C/100;
    if(a==b==c||(a==4&&b==9&&c==5))
        printf("0");
    team(a,b,c);
    do{A=a*100+b*10+c;
        B=c*100+b*10+a;
        C=A-B;
        printf("%d-%d=%d",&A,&B,&C);
        a=C%10;
        b=(C/10)%10;
        c=C/100;
    team(a,b,c);
    }while(C!=495);
    return 0;
}

void team(int a,int b,int c){
    int d;
    if(a>b)
        if(c>b)
        {d=c;
        c=b;
        b=d;}
    else {
        d=a;
        a=b;
        b=d;
        if(b<c)
        {d=c;
        c=b;
        b=d;}
    }}





#include<stdio.h>
int m[13];
int main(){
    int i,total,year,month,day;
    total=0;
    void day_month_year(int year,int month,int day);
    printf("year,month,day",&year,&month,&day);
    day_month_year(year,month,day);
    for(i=1;i<month;i++){
    total=total+m[i];
    }
    total=total+day;
    printf("是%d年的第%d天",year,total);
    return 0;
}

void day_month_year(int year,int month,int day){
    if((year%4==0&&year%100!=0)&&year%400==0)
        m[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
    else
        m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

求大神指出错误!谢谢~
搜索更多相关主题的帖子: include number 
2017-02-22 10:02



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-474430-1-1.html




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

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