L1-030. 一帮一

L1-030. 一帮一
时间限制
400 ms
内存限制
65536 kB
代码长度限制
8000 B
判题程序
Standard
作者
陈越
“一帮一学习小组”是中小学中常见的学习组织方式,老师把学习成绩靠前的学生跟学习成绩靠后的学生排在一组。本题就请你编写程序帮助老师自动完成这个分配工作,即在得到全班学生的排名后,在当前尚未分组的学生中,将名次最靠前的学生与名次最靠后的异性学生分为一组。

输入格式:

输入第一行给出正偶数N(<=50),即全班学生的人数。此后N行,按照名次从高到低的顺序给出每个学生的性别(0代表女生,1代表男生)和姓名(不超过8个英文字母的非空字符串),其间以1个空格分隔。这里保证本班男女比例是1:1,并且没有并列名次。

输出格式:

每行输出一组两个学生的姓名,其间以1个空格分隔。名次高的学生在前,名次低的学生在后。小组的输出顺序按照前面学生的名次从高到低排列。

输入样例:
8
0 Amy
1 Tom
1 Bill
0 Cindy
0 Maya
1 John
1 Jack
0 Linda
输出样例:
Amy Jack
Tom Linda
Bill Maya
Cindy John

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


int main()
{
    int n,i,j;
    int sex[50];
    char name[50][20];
    int a[50]={0};
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&sex[i]);
        scanf("%s",name[i]);
    }
    for(i=0;i<n;i++)//从左边查
        for(j=n-1;j>=0;j--)//从右边查
    {
        if(a[i]==0&&a[j]==0&&sex[i]!=sex[j])
        {
            printf("%s %s\n",name[i],name[j]);
            a[i]=1;//将输出的用1替换
            a[j]=1;
        }
    }
    return 0;
}
我有个python封装成的exe文件,我想从源文件看看它是怎么实现的。帮我看下这个文件目录,我应该从何下手: E:. │ ble.py │ ble.spec │ BleakUWPBridge.dll │ bt_ctrl.py │ bt_ctrl.spec │ test_ble.py │ test_ble.spec │ 蓝牙控制程序说明.docx │ ├─.idea │ │ .gitignore │ │ bluetooth.iml │ │ misc.xml │ │ modules.xml │ │ workspace.xml │ │ │ └─inspectionProfiles │ profiles_settings.xml │ ├─build │ └─test_ble │ Analysis-00.toc │ base_library.zip │ COLLECT-00.toc │ EXE-00.toc │ PKG-00.toc │ PYZ-00.pyz │ PYZ-00.toc │ test_ble.exe │ test_ble.exe.manifest │ test_ble.pkg │ Tree-00.toc │ warn-test_ble.txt │ xref-test_ble.html │ ├─dist │ │ ble.exe │ │ test_ble.zip │ │ │ └─test_ble │ │ api-ms-win-core-console-l1-1-0.dll │ │ api-ms-win-core-datetime-l1-1-0.dll │ │ api-ms-win-core-debug-l1-1-0.dll │ │ api-ms-win-core-errorhandling-l1-1-0.dll │ │ api-ms-win-core-file-l1-1-0.dll │ │ api-ms-win-core-file-l1-2-0.dll │ │ api-ms-win-core-file-l2-1-0.dll │ │ api-ms-win-core-handle-l1-1-0.dll │ │ api-ms-win-core-heap-l1-1-0.dll │ │ api-ms-win-core-interlocked-l1-1-0.dll │ │ api-ms-win-core-libraryloader-l1-1-0.dll │ │ api-ms-win-core-localization-l1-2-0.dll │ │ api-ms-win-core-memory-l1-1-0.dll │ │ api-ms-win-core-namedpipe-l1-1-0.dll │ │ api-ms-win-core-processenvironment-l1-1-0.dll │ │ api-ms-win-core-processthreads-l1-1-0.dll │ │ api-ms-win-core-processthreads-l1-1-1.dll │ │ api-ms-win-core-profile-l1-1-0.dll │ │ api-ms-win-core-rtlsupport-l1-1-0.dll │ │ api-ms-win-core-string-l1-1-0.dll │ │ api-ms-win-core-synch-l1-1-0.dll │ │ api-ms-win-core-synch-l1-2-0.dll │ │ api-ms-win-core-sysinfo-l1-1-0.dll │ │ api-ms-win-core-timezone-l1-1-0.dll │ │ api-ms-win-core-util-l1-1-0.dll │ │ api-ms-win-crt-conio-l1-1-0.dll │ │ api-ms-win-crt-convert-l1-1-0.dll │ │ api-ms-win-crt-environment-l1-1-0.dll │ │ api-ms-win-crt-filesystem-l1-1-0.dll │ │ api-ms-win-crt-heap-l1-1-0.dll │ │ api-ms-win-crt-locale-l1-1-0.dll │ │ api-ms-win-crt-math-l1-1-0.dll │ │ api-ms-win-crt-process-l1-1-0.dll │ │ api-ms-win-crt-runtime-l1-1-0.dll │ │ api-ms-win-crt-stdio-l1-1-0.dll │ │ api-ms-win-crt-string-l1-1-0.dll │ │ api-ms-win-crt-time-l1-1-0.dll │ │ api-ms-win-crt-utility-l1-1-0.dll │ │ base_library.zip │ │ clr.pyd │ │ pyexpat.pyd │ │ Python.Runtime.dll │ │ python36.dll │ │ pywintypes36.dll │ │ select.pyd │ │ test_ble.exe │ │ ucrtbase.dll │ │ unicodedata.pyd │ │ VCRUNTIME140.dll │ │ win32wnet.pyd │ │ _asyncio.pyd │ │ _bz2.pyd │ │ _ctypes.pyd │ │ _decimal.pyd │ │ _hashlib.pyd │ │ _lzma.pyd │ │ _multiprocessing.pyd │ │ _overlapped.pyd │ │ _socket.pyd │ │ _ssl.pyd │ │ │ └─bleak │ └─backends │ └─dotnet │ BleakUWPBridge.dll │ └─__pycache__ ble.cpython-36.pyc bt_ctrl.cpython-36.pyc test_ble.cpython-36.pyc
最新发布
09-30
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值