看见他计划


私信TA

用户名:hg59201

访问量:21327

签 名:

等  级
排  名 779
经  验 3600
参赛次数 0
文章发表 29
年  龄 0
在职情况 学生
学  校 河北工程大学
专  业

  自我简介:

#include<stdio.h>
#include<string.h>
int main()
{ char stg[200],sgs[200],stc[200];//数组要足够大,第一次填了20,就运行出错,
  int u,p,h;
  int bijiao(char qq[],char ww[]);
  int paixu(char ee[],char rr[],char yy[]);
    gets(stg);
    gets(sgs);
    gets(stc);
  u=paixu(stg,sgs,stc);
  p=paixu(sgs,stg,stc);
  h=paixu(stc,stg,sgs);
  if(u==3)
  puts(stg);
  if(p==3)
  puts(sgs);
  if(h==3)
  puts(stc);
  if(u==2)
  puts(stg);
  if(p==2)
  puts(sgs);
  if(h==2)
  puts(stc);
  if(u==1)
  puts(stg);
  if(p==1)
  puts(sgs);
  if(h==1)
  puts(stc);
}
int bijiao(char qq[],char ww[])
{ int i,j,n,m;
  n=strlen(qq);
  m=strlen(ww);
  for(i=0;i<n;i++)
  { m--;
    if(m<0)
    return 1;
    else if(qq[i]<ww[i])
    return 2;
    else if(qq[i]>ww[i])
    return 1;
    else if(i==n-1)
    return 2;
  }
}
int paixu(char ee[],char rr[],char yy[])
{ int bijiao(char qq[],char ww[]);
  if(bijiao(ee,rr)==1&&bijiao(ee,yy)==1)
  return 1;
  if((bijiao(ee,rr)==1&&bijiao(ee,yy)==2)||(bijiao(ee,rr)==2&&bijiao(ee,yy)==1))
  return 2;
  if(bijiao(ee,rr)==2&&bijiao(ee,yy)==2)
  return 3;
}










 

0.0分

1 人评分

  评论区