题解 | #序列找数#

序列找数

http://www.nowcoder.com/practice/a7d1856a72404ea69fdfb5786d65539c

代码实现:

public class Main {
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int sum = 0;
        while(sc.hasNext()) sum += sc.nextInt();
        System.out.println((1 + n)*n/2 - sum);
    }
}

全部评论

相关推荐

找工作勤劳小蜜蜂:矛盾是没有实习,就是没实战经验,公司不想要,公司不要,你就没有实习,你就进入死循环,另外你的项目不是社会现在有大量岗位存在行业用的,云存储人员早就饱和。
点赞 评论 收藏
分享
04-14 12:52
已编辑
门头沟学院 C++
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务