资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Java中的IO怎么中ICPC中实现

这篇文章将为大家详细讲解有关Java中的IO怎么中ICPC中实现,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

创新互联于2013年创立,是专业互联网技术服务公司,拥有项目成都网站制作、做网站网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元溪湖做网站,已为上家服务,为溪湖各地企业和个人服务,联系电话:028-86922220

具体方法如下:

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Comparator;
import java.io.InputStream; 
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
 public static void main(String[] args) {
 InputStream inputStream = System.in;
 OutputStream outputStream = System.out;
 InputReader in = new InputReader(inputStream);
 PrintWriter out = new PrintWriter(outputStream);
 TaskD solver = new TaskD();
 solver.solve(1, in, out);
 out.close();
 } 
 static class TaskD {
 public void solve(int testNumber, InputReader in, PrintWriter out) { 
 }
 } 
 static class InputReader {
 public BufferedReader reader;
 public StringTokenizer tokenizer;
 public InputReader(InputStream stream) {
 reader = new BufferedReader(new InputStreamReader(stream), 32768);
 tokenizer = null;
 }
 public String next() {
 while (tokenizer == null || !tokenizer.hasMoreTokens()) {
 try {
  tokenizer = new StringTokenizer(reader.readLine());
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 }
 return tokenizer.nextToken();
 } 
 public int nextInt() {
 return Integer.parseInt(next());
 } 
 }
}

处理EOF:

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Random;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.Comparator;
import java.io.InputStream;
 
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
 public static void main(String[] args) {
 InputStream inputStream = System.in;
 OutputStream outputStream = System.out;
 InputReader in = new InputReader(inputStream);
 PrintWriter out = new PrintWriter(outputStream);
 TaskD solver = new TaskD();
 solver.solve(1, in, out);
 out.close();
 } 
 static class TaskD {
 public void solve(int testNumber, InputReader in, PrintWriter out) {
 while(in.hasNext())
 {
 int a=in.nextInt();
 int b=in.nextInt();
 System.out.println(a+b);
 }
 }
 }
 static class InputReader {
 public BufferedReader reader;
 public StringTokenizer tokenizer;
 public InputReader(InputStream stream) {
 reader = new BufferedReader(new InputStreamReader(stream), 32768);
 tokenizer = null;
 } 
 public boolean hasNext() {
 while (tokenizer == null || !tokenizer.hasMoreTokens()) {
 try {
  String line = reader.readLine();
  if(line == null) return false;
  tokenizer = new StringTokenizer(line);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 }
 return true;
 }
 public String next()
 {
 return tokenizer.nextToken();
 }
 public int nextInt() {
 return Integer.parseInt(next());
 }
 }
}

关于Java中的IO怎么中ICPC中实现就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。


网页名称:Java中的IO怎么中ICPC中实现
标题网址:http://cdkjz.cn/article/gidcjh.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220