牛客网月赛 F.Fool Problem(找规律题)

在这里插入图片描述

#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string x;
    cin >> x;
    cout << (x.back() % 2 ? -1 : 1);
     //back() 函数返回当前vector最末一个元素的引用。
}


发布了344 篇原创文章 · 获赞 128 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/king9666/article/details/104336349