Java中这种箭头是什么意思?
在别人做的题目中看到的importjava.io.BufferedInputStream;importjava.io.BufferedOutputStream;impor...
在别人做的题目中看到的
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
static Scanner cin;
static PrintWriter cout;
static {
try {
cin = new Scanner(new BufferedReader(new FileReader("A.in")));
cout = new PrintWriter(new BufferedWriter(new FileWriter("A.out")));
} catch (IOException e) {
cin = new Scanner(new BufferedInputStream(System.in));
cout = new PrintWriter(new BufferedOutputStream(System.out));
}
}
public static void main(String[] args) {
for (int T=cin.nextInt(); cin.hasNext()&&T-->0; solve(cin.next())); //就是这里
closeIO();
}
final static char[]PRONOUNCE="OOTTFFSSEN".toCharArray();
private static void solve(String number) {
for(int i=number.length()-1;i>=0;i--)
cout.print(PRONOUNCE[number.charAt(i)-'0']);
cout.println();
}
private static void closeIO() {
if (cin != null) cin.close();
if (cout != null) cout.close();
}
} 展开
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
static Scanner cin;
static PrintWriter cout;
static {
try {
cin = new Scanner(new BufferedReader(new FileReader("A.in")));
cout = new PrintWriter(new BufferedWriter(new FileWriter("A.out")));
} catch (IOException e) {
cin = new Scanner(new BufferedInputStream(System.in));
cout = new PrintWriter(new BufferedOutputStream(System.out));
}
}
public static void main(String[] args) {
for (int T=cin.nextInt(); cin.hasNext()&&T-->0; solve(cin.next())); //就是这里
closeIO();
}
final static char[]PRONOUNCE="OOTTFFSSEN".toCharArray();
private static void solve(String number) {
for(int i=number.length()-1;i>=0;i--)
cout.print(PRONOUNCE[number.charAt(i)-'0']);
cout.println();
}
private static void closeIO() {
if (cin != null) cin.close();
if (cout != null) cout.close();
}
} 展开
2个回答
展开全部
for (int T=cin.nextInt(); cin.hasNext()&&T-->0; solve(cin.next()) );
cin.hasNext()&&T-->0 这是个条件表达式
(cin.hasNext() ) && ( (T--) >0) 这样就明白了吧
cin.hasNext()&&T-->0 这是个条件表达式
(cin.hasNext() ) && ( (T--) >0) 这样就明白了吧
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不了解哟,关注一下,等高手来看看吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询