爱问知识人 爱问教育 医院库

一道编程题

首页

一道编程题

两个乒乓球队进行比赛,各出3人。甲队为A、B、C3人,乙队为X、Y、Z3人。已抽签决定比赛名单。有人向队员打听比赛的名单,A说他不和X比,C说他不和X、Z比,请编程序找出3对赛手的名单。

提交回答
好评回答
  • 2005-01-16 18:29:34
      我给你下面的程序:(已经调试通过,并且证明是对的。
      )#includemain(){charFirstEmulant,SecondEmulant,ThirdEmulant;//依次代表甲队三个队员的对手for(FirstEmulant='X';FirstEmulant<='Z';FirstEmulant++){for(SecondEmulant='X';SecondEmulant<='Z';SecondEmulant++){if(FirstEmulant!=SecondEmulant){for(ThirdEmulant='X';ThirdEmulant<='Z';ThirdEmulant++){if(ThirdEmulant!=FirstEmulant&&ThirdEmulant!=SecondEmulant){if(FirstEmulant!='X'&&ThirdEmulant!='X'&&ThirdEmulant!='Z'){printf("Result:\n\tAvs%c\n\tBvs%c\n\tCvs%c\n",FirstEmulant,SecondEmulant,ThirdEmulant);}}}}}}}/////////////////////////////////////////这个程序的运行结果是: 。

    h***

    2005-01-16 18:29:34

类似问题

换一换
  • C/C++ 相关知识

  • 电脑网络技术
  • 电脑网络

相关推荐

正在加载...
最新问答 推荐信息 热门专题 热点推荐
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200
  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 181-200

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 173-192
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):