zoukankan      html  css  js  c++  java
  • L1-041 寻找250 (10分)

    L1-041 寻找250 (10分)


    对方不想和你说话,并向你扔了一串数…… 而你必须从这一串数字中找到 (250) 这个高大上的感人数字。

    输入格式:

    输入在一行中给出不知道多少个绝对值不超过 (1000) 的整数,其中保证至少存在一个 (250)

    输出格式:

    在一行中输出第一次出现的 (250) 是对方扔过来的第几个数字(计数从 (1) 开始)。题目保证输出的数字在整型范围内。

    输入样例:

    888 666 123 -233 250 13 250 -222
    

    代码:

    #include<bits/stdc++.h>
    using namespace std;
    int x,ans;
    int main()
    {
        while(cin>>x)
        {
            ans++;
            if(x==250)return cout<<ans<<endl,0;
        }
        return 0;
    }
    
  • 相关阅读:
    Mysql其他
    Linux大全
    Django-你想知道的都在这里
    k8s
    极速安装k8s 快速融入学习
    flask orm
    Elasticsearch
    1爬虫
    MY git 操作
    docker 骚操作
  • 原文地址:https://www.cnblogs.com/LengYun/p/13157859.html
Copyright © 2011-2022 走看看