L1-035 情人节 (15分) (学习心得)

心得:

c/c++里面。“”里面的才是字符串,越学越傻了,‘’是获取ascii码

#include <iostream>
#include<cstring>
using namespace std;
int main()
{
   char s[100][100];
    int i = 0;
    while(cin>>s[i++])
    {

        if(!strcmp(s[i-1],".")) break;
    }
    if(i<=2) printf("Momo... No one is for you ...\n");
    else if(i-1>=14)
    {
        cout<<s[1];
        printf(" and ");
        cout<<s[13];
        printf(" are inviting you to dinner...\n");
    }
    else
    {
        cout<<s[1];
        printf(" is the only one for you...\n");
    }
    return 0;
}

posted @ 2022-08-28 08:45  翔村亲亲鸟  阅读(18)  评论(0编辑  收藏  举报