codeforces 69A(Young Physicist) Java
来源:互联网 发布:数据链路层的数据单位 编辑:程序博客网 时间:2024/05/23 01:14
水题,提神专用!!!
import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.io.PrintWriter;import java.io.StreamTokenizer;/** * 题意:输入 n 行,每行三个数。每列的数相加都等于零,就输出"YES",否则输出"NO" */public class Main { public static void main(String[] args) throws IOException { StreamTokenizer in = new StreamTokenizer(new BufferedReader( new InputStreamReader(System.in))); PrintWriter out = new PrintWriter(new BufferedWriter( new OutputStreamWriter(System.out))); int lineNum; // 行数 int sumA; int sumB; int sumC; while (in.nextToken() != StreamTokenizer.TT_EOF) { lineNum = (int) in.nval; sumA = 0; sumB = 0; sumC = 0; while (lineNum-- != 0) { in.nextToken(); sumA += in.nval; in.nextToken(); sumB += in.nval; in.nextToken(); sumC += in.nval; } out.println(sumA == 0 && sumB == 0 && sumC == 0 ? "YES" : "NO"); } out.flush(); }}
阅读全文
0 0
- codeforces 69A(Young Physicist) Java
- codeforces 69A Young Physicist
- 69A - Young Physicist
- Codeforces Young Physicist
- A. Young Physicist
- 【水】#63 A. Young Physicist
- Codeforces--237B--Young Table(模拟)
- CodeForces - 237B Young Table (模拟)
- Search a Young Tableau
- codeforces 14B. Young Photographer
- CodeForces 14B Young Photographer
- Letter to a Young Developer
- Letter to a Young Developer
- Letter to a Young Developer
- codeforces 116A(Tram) Java
- codeforces 281A(Word Capitalization) Java
- codeforces 131A(cAPS lOCK) Java
- codeforces 133A(HQ9+) Java
- flashback database闪回数据库
- servlet
- ios开发设置icon和Launch图标
- arcgis-online-python-scripts
- Camtasia Studio 9.0.5 中文破解版安装教程(微课制作软件)
- codeforces 69A(Young Physicist) Java
- xml中配置定时任务
- OpenTSDB简介
- OSMOCOMBB新手指南
- Hello Kotlin(四)变量和属性
- vue.js字符串转化json
- android.os.NetworkOnMainThreadException,Android根据图片URL加载图片
- 日期 bootsrtap-datatimepicker and bootstrap-datepicker 支持中文
- Android apk 反汇编