Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
FullStackPark
Knowledge
Repository navigation
Code
Issues
2
(2)
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
Knowledge
/
Python2-Example100
/
Exercise022.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
12 lines (11 loc) · 823 Bytes
master
Breadcrumbs
Knowledge
/
Python2-Example100
/
Exercise022.py
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
12 lines (11 loc) · 823 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#题目:两个乒乓球队进行比赛,各出三人。甲队为a,b,c三人,乙队为x,y,z三人。已抽签决定比赛名单。有人向队员打听
# 比赛的名单。a说他不和x比,c说他不和x,z比,请编程序找出三队赛手的名单
for
i
in
range
(
ord
(
'x'
),
ord
(
'z'
)
+
1
):
#遍历3人,i是a,j是b,k是c
for
j
in
range
(
ord
(
'x'
),
ord
(
'z'
)
+
1
):
if
i
!=
j
:
#找出所有组合情况,除开两人和一人比情况
for
k
in
range
(
ord
(
'x'
),
ord
(
'z'
)
+
1
):
if
(
i
!=
k
)
and
(
j
!=
k
):
if
(
i
!=
ord
(
'x'
))
and
(
k
!=
ord
(
'x'
))
and
(
k
!=
ord
(
'z'
)):
print
'order is a -- %s
\t
b -- %s
\t
c--%s'
%
(
chr
(
i
),
chr
(
j
),
chr
(
k
))
You can’t perform that action at this time.