首页 > 其他 > 详细

题解 SP1 【TEST - Life, the Universe, and Everything】

时间:2018-02-03 17:15:39      阅读:275      评论:0      收藏:0      [点我收藏+]

题解 SP1 【TEST - Life, the Universe, and Everything】

这是一道SPOJ的试机题,题目简单,但是还是不像A+B problem那样简单。

解题思路:(For 像我这样的新手们的)边读入边输出,这个程序在你的电脑上可能会得到很奇怪的答案,但是这在算法竞赛中是可以的。对于42以后的甚至可以不用读入了。

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a;
    while(1){
        cin>>a;
        if(a==42)break;
        cout<<a<<endl; 
    } 
}

  

题解 SP1 【TEST - Life, the Universe, and Everything】

原文:https://www.cnblogs.com/Douglas-Zhou/p/SP1.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!