1873.Once upon a time
时间限制 1000 ms 内存限制 256 MB
Once upon a time, there was a mountain. Over the mountain there was a temple. In the temple, there was an old monk telling a story. This is the story: Once upon a time, there was a mountain. Over the mountain there was a temple. In the temple, there was an old monk telling a story. This is the story: Once upon a time, there was a mountain. Over the mountain there was a temple. In the temple, there was an old monk telling a story. This is the story…
显然,这是个无穷无尽的故事,yinmz想知道,这个故事的第 n
n
个字母是什么。
import java.util.*;
public class Main
{
public static void main(String []args)
{
Scanner s = new Scanner(System.in);
String h= “OnceuponatimetherewasamountainOverthemountaintherewasatempleInthetempletherewasanoldmonktellingastoryThisisthestory”;
int k=h.length();
long n=s.nextLong();
int r=(int) (n%k);
char t=h.charAt(r-1);
if(t<'a')
{
t=(char) (t+'a'-'A');
}
System.out.println(t);
}
}