L1-3. 情人节

L1-3. 情人节

以上是朋友圈中一奇葩贴:“2月14情人节了,我决定造福大家。第2个赞和第14个赞的,我介绍你俩认识…………咱三吃饭…你俩请…”。现给出此贴下点赞的朋友名单,请你找出那两位要请客的倒霉蛋。

输入格式:

输入按照点赞的先后顺序给出不知道多少个点赞的人名,每个人名占一行,为不超过10个英文字母的非空单词,以回车结束。一个英文句点“.”标志输入的结束,这个符号不算在点赞名单里。

输出格式:

根据点赞情况在一行中输出结论:若存在第2个人A和第14个人B,则输出“A and B are inviting you to dinner…”;若只有A没有B,则输出“A is the only one for you…”;若连A都没有,则输出“Momo… No one is for you …”。

输入样例1:
GaoXZh
Magi
Einst
Quark
LaoLao
FatMouse
ZhaShen
fantacy
latesum
SenSen
QuanQuan
whatever
whenever
Potaty
hahaha
.
输出样例1:
Magi and Potaty are inviting you to dinner…
输入样例2:
LaoLao
FatMouse
whoever
.
输出样例2:
FatMouse is the only one for you…
输入样例3:
LaoLao
.
输出样例3:
Momo… No one is for you …

#include <iostream>
using namespace std;
int main()
{   
    string A, B, C;
    int i = 1;
    for(; ; i++) {
        if(i == 1) {
            cin >> C; 
            if(C[0] == '.') {
                cout << "Momo... No one is for you ...";
                return 0;
            } 
        } else if(i == 2) {
            cin >> A;
            if(A[0] == '.') {
                cout << "Momo... No one is for you ...";
                return 0;
            }
        } else if(i == 14) {
            cin >> B;
            if(B[0] == '.') {
                cout << A << " is the only one for you...";
            }
        } else {
            cin >> C;
            if(C[0] == '.') {
                break;
            } 
        } 
    } 
    if (i < 14) {
        cout << A <<" is the only one for you...";
        return 0;
    } else if(i > 14) {
        cout << A << " and " << B << " are inviting you to dinner..."; 
    } 
    return 0;
 } 
root@ubuntu22:~/FPGAs_AdaptiveSoCs_Unified_2024.1_0522_2023# ls api-ms-win-core-console-l1-1-0.dll api-ms-win-core-synch-l1-1-0.dll bin api-ms-win-core-datetime-l1-1-0.dll api-ms-win-core-synch-l1-2-0.dll concrt140.dll api-ms-win-core-debug-l1-1-0.dll api-ms-win-core-sysinfo-l1-1-0.dll data api-ms-win-core-errorhandling-l1-1-0.dll api-ms-win-core-timezone-l1-1-0.dll installLibs.sh api-ms-win-core-file-l1-1-0.dll api-ms-win-core-util-l1-1-0.dll lib api-ms-win-core-file-l1-2-0.dll api-ms-win-crt-conio-l1-1-0.dll msvcp140_1.dll api-ms-win-core-file-l2-1-0.dll api-ms-win-crt-convert-l1-1-0.dll msvcp140_2.dll api-ms-win-core-handle-l1-1-0.dll api-ms-win-crt-environment-l1-1-0.dll msvcp140.dll api-ms-win-core-heap-l1-1-0.dll api-ms-win-crt-filesystem-l1-1-0.dll payload api-ms-win-core-interlocked-l1-1-0.dll api-ms-win-crt-heap-l1-1-0.dll scripts api-ms-win-core-libraryloader-l1-1-0.dll api-ms-win-crt-locale-l1-1-0.dll tps api-ms-win-core-localization-l1-2-0.dll api-ms-win-crt-math-l1-1-0.dll ucrtbase.dll api-ms-win-core-memory-l1-1-0.dll api-ms-win-crt-multibyte-l1-1-0.dll vccorlib140.dll api-ms-win-core-namedpipe-l1-1-0.dll api-ms-win-crt-private-l1-1-0.dll vcruntime140_1.dll api-ms-win-core-processenvironment-l1-1-0.dll api-ms-win-crt-process-l1-1-0.dll vcruntime140.dll api-ms-win-core-processthreads-l1-1-0.dll api-ms-win-crt-runtime-l1-1-0.dll xsetup api-ms-win-core-processthreads-l1-1-1.dll api-ms-win-crt-stdio-l1-1-0.dll xsetup.exe api-ms-win-core-profile-l1-1-0.dll api-ms-win-crt-string-l1-1-0.dll xsetup.exe.manifest api-ms-win-core-rtlsupport-l1-1-0.dll api-ms-win-crt-time-l1-1-0.dll api-ms-win-core-string-l1-1-0.dll api-ms-win-crt-utility-l1-1-0.dll 这是linux版本还是windows版本
最新发布
07-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值