首页 > 其他 > 详细

codeforces水题100道 第九题 Codeforces Beta Round #63 (Div. 2) Young Physicist (math)

时间:2016-07-20 17:47:46      阅读:179      评论:0      收藏:0      [点我收藏+]

题目链接:http://www.codeforces.com/problemset/problem/69/A
题意:给你n个三维空间矢量,求这n个矢量的矢量和是否为零。
C++代码:

技术分享
#include <cstdio>
#include <iostream>
using namespace std;
int x, y, z;
int main()
{
    int n, tx, ty, tz;
    cin >> n;
    while (n--)
    {
        cin >> tx >> ty >> tz;
        x += tx, y += ty, z += tz;
    }
    puts(!x && !y && !z ? "YES" : "NO");
    return 0;
}
C++

 

codeforces水题100道 第九题 Codeforces Beta Round #63 (Div. 2) Young Physicist (math)

原文:http://www.cnblogs.com/moonlightpoet/p/5688959.html

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