admin 管理员组文章数量: 887021
2023年12月17日发(作者:php导航猫导航系统网站源码)
浙大java练-40001-50004
LT题答案习
40001
import r;
public class Test40001 {
public static void main(String[] args) {
int ri, repeat;
int i, n;
float sum;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*--------------------*/
n((int)(sum*1000+0.5)/1000.);
}
}
}
40002
import r;
public class Test40002 {
public static void main(String[] args) {
int ri, repeat;
int i, n;
double fact;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*--------------------*/
n(fact);
}
}
}
40003
import r;
public class Test40003 {
public static void main(String[] args) {
int ri, repeat;
int i, n;
double x, mypow;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
x=uble();
n=t();
/*--------------------*/
n(mypow);
}
}
}
40004
import r;
public class Test40004 {
public static void main(String[] args) {
int ri, repeat;
int i, n, flag;
float sum;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*--------------------*/
n((long)(sum*10000+0.5)/10000.);
}
}
}
40005
import r;
public class Test40005 {
public static void main(String[] args) {
int ri, repeat;
int i, n, temp;
float sum;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*--------------------*/
sum=0;
for(i=1;i<=n;i++){
sum=(float) (sum+1.0/(2*i-1));
}
n(sum);
}
}
}
40006
import r;
public class Test40006 {
public static void main(String[] args) {
int ri, repeat;
int temp, flag;
double eps, item, sum;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
eps=uble();
/*--------------------*/
n((int)(sum*10000+0.5)/10000.);
}
}
}
40007
import r;
public class Test40007 {
public static void main(String[] args){
int ri, repeat;
int begin, c, end, f;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
begin=t();
end=t();
n("Celsius Fahrenheit");
/*--------------------*/
n(c+" "+f);
}
}
}
}
40008
import r;
public class Test40008 {
public static void main(String[] args){
int ri, repeat;
int x, sum;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
x=t();
/*--------------------*/
}
n(sum);
}
}
}
40009
import r;
public class Test40009 {
public static void main(String[] args){
int ri, repeat;
int i , max, n, x;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*--------------------*/
}
n(max);
}
}
}
40010
import r;
public class Test40010 {
public static void main(String[] args){
int ri, repeat;
int number, sum,n,r;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*--------------------*/
n("number="+number+", sum="+sum);
}
}
}
40011
import r;
public class Test40011 {
public static void main(String[] args) {
int ri, repeat;
int i,n;
float a,b,s,t;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*--------------------*/
n((int)(s*10000+.5)/10000.);
}
}
}
40012
import r;
public class Test40012{
public static void main(String args[]){
int ri, repeat;
int i, n, a, sn, tn;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
a=t();
n=t();
/*--------------------*/
n(sn);
}
}
}
40013
import r;
public class Test40013{
public static void main(String args[]){
int ri, repeat;
int i, m, n;
boolean flag=true;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
m=t();
/*--------------------*/
}
if(flag) n("YES");
else n("NO");
}
}
}
40014
import .*;
public class Test40014 {
public static void main(String []args){
Scanner in =new Scanner();
int gcd, lcm, m, n,r;
int repeat, ri;
repeat=t();
for(ri = 1; ri <= repeat; ri++){
m=t();
n=t();
if(m <= 0 || n <= 0)
n("m <= 0 or n <= 0");
else{
/*---------*/
n("the least common multiple:"+lcm+", the
greatest common divisor:"+gcd);
}
}
}
}
40021
import r;
public class Test40021{
public static void main(String args[]){
int ri, repeat;
int i,n;
float s,t;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*--------------------*/
n((int)(s*10000+0.5)/10000.);
}
}
}
40022
import r;
public class Test40022{
public static void main(String args[]){
int ri, repeat;
int i, digit, m, n, number, sum;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
m=t();
n=t();
/*------------------*/
}
}
}
40023
import r;
public class Test40023{
public static void main(String args[]){
int ri, repeat;
int count, i, j, k, m, n, sum;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
m=t();
n=t();
/*---------------------*/
n("count="+count+", sum="+sum);
}
}
}
40031
import r;
public class Test40031{
public static void main(String []args ){
int ri, repeat,count, word,i;
String line;
char c;
Scanner in=new Scanner();
repeat=(ne()).charAt(0)-'0'; //输入repeat
for(ri=1; ri<=repeat; ri++){
line=ne(); //输入一行字符
/*---------*/
n(count);
}
}
}
40032
import r;
public class Test40032{
public static void main(String []args ){
int ri, repeat;
int digit;
long n, temp, pow;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=ng();
/*---------*/
n();
}
}
}
40033
import r;
public class Test40033{
public static void main(String args[]) {
int ri, repeat;
int op1, op2, res;
char operator;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
op1=t();
operator =(()).charAt(0);
/*---------*/
n(res);
}
}
}
40034
import r;
public class Test40034{
public static void main(String []args){
int year,m,n,repeat,ri;
Scanner in=new Scanner();
repeat=t();
for(ri=1;ri<=repeat;ri++){
m=t();
n=t();
/*---------*/
}
}
}
40035
import r;
public class Test40035{
public static void main(String []args){
int m,n,repeat,ri;
Scanner in=new Scanner();
repeat=t();
for(ri=1;ri<=repeat;ri++){
n=t();
m=t();
/*---------*/
}
}
}
40036
import r;
public class Test40036{
public static void main(String []args){
int days,repeat,ri;
Scanner in=new Scanner();
repeat=t();
for(ri=1;ri<=repeat;ri++){
}
}
}
40037
import r;
public class Test40037{
public static void main(String []args){
int a,n,ri,count,number;
double sum,ave;
Scanner in=new Scanner();
n=t();
for(ri=1;ri<=n;ri++){
/。。。。。。。。。。/
n("average="+(ave*100)/100.);
n("count="+count);
}
}
}
50001
import r;
public class Test50001 {
public static void main(String[] args) {
int ri,repeat;
int i,n;
double s;
Scanner in=new Scanner();
repeat=t();
for(ri=1;ri<=repeat;ri++){
n=t();
/*-----------*/
n((long)(s*10000+0.5)/10000.);
}
}
/*---------------*/
}
50002
import r;
public class Test50002{
public static void main(String args[]){
int ri, repeat;
int i, n,a;
long sn;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
a=t();
n=t();
/*------------*/
n(sn);
}
}
/*------------*/
}
50003
import r;
public class Test50003{
public static void main(String args[]){
int ri, repeat;
int count;
long n;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*---------*/
}
}
/*------------*/
}
50004
import r;
public class Test50004{
public static void main(String args[]){
int ri, repeat,n;
boolean flag;
Scanner in=new Scanner();
repeat=t();
for(ri=1; ri<=repeat; ri++){
n=t();
/*---------*/
if(flag) n("YES");
else n("NO");
}
}
/*------------*/
}
版权声明:本文标题:浙大java练习题答案-40001-50004 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1702799386h431353.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论