蓝桥杯 练习系统 基础练习答案JavaWord格式.docx
- 文档编号:22286876
- 上传时间:2023-02-03
- 格式:DOCX
- 页数:30
- 大小:18.75KB
蓝桥杯 练习系统 基础练习答案JavaWord格式.docx
《蓝桥杯 练习系统 基础练习答案JavaWord格式.docx》由会员分享,可在线阅读,更多相关《蓝桥杯 练习系统 基础练习答案JavaWord格式.docx(30页珍藏版)》请在冰豆网上搜索。
for(inti=0;
i<
l1;
i++){
a[l1-1-i]=Character.getNumericValue(s1.charAt(i));
l2;
b[l2-1-i]=Character.getNumericValue(s2.charAt(i));
intmax=l1>
l2?
l1:
intc[]=newint[100000];
max;
c[i]=a[i]+b[i];
max-1;
if(c[i]>
9){
c[i+1]+=c[i]/10;
c[i]=c[i]%10;
while(c[max-1]>
c[max]=c[max-1]/10;
c[max-1]=c[max-1]%10;
max++;
for(inti=max-1;
i>
=0;
i--){
System.out.print(c[i]);
28
importjava.io.*;
publicclassMain{
publicstaticvoidmain(String[]args)throwsIOException{
BufferedReaderbuf=newBufferedReader(newInputStreamReader(System.in));
intn=Integer.parseInt(buf.readLine());
Stringstr=buf.readLine();
Strings[]=str.split("
"
);
intsum=0;
inta[]=newint[n];
intnum=0;
i<
n;
i++)
a[i]=Integer.parseInt(s[i]);
java.util.Arrays.sort(a);
if(n>
1){
sum=a[0]+a[1];
num=sum;
a[1]=num;
for(intj=2;
j<
j++){
if(j<
n){
java.util.Arrays.sort(a);
num=a[j-1]+a[j];
a[j]=num;
java.util.Arrays.sort(a);
sum+=num;
}
else{
sum=a[0];
System.out.println(sum);
27
importjava.util.Scanner;
publicstaticintn=0;
publicstaticinta[]=newint[10];
publicstaticintisa[][]=newint[10][10];
publicstaticbooleanflag=false;
publicstaticintsum=0;
publicstaticbooleanjudge(intk){
for(intj=1;
j<
k;
j++){
if(Math.abs(j-k)==Math.abs(a[j]-a[k])||a[j]==a[k])
returnfalse;
returntrue;
publicstaticvoidplace(intt){
if(t>
n&
&
!
flag){
flag=true;
place
(1);
flag=false;
}elseif(t>
flag){
sum++;
}else{
for(inti=1;
i<
=n;
i++){
if(isa[t][i]==1){
inttemp=a[t];
a[t]=i;
if(judge(t)){
isa[t][i]=2;
place(t+1);
isa[t][i]=1;
}
a[t]=temp;
}
Scannersc=newScanner(System.in);
n=sc.nextInt();
for(inti=1;
for(intj=1;
isa[i][j]=sc.nextInt();
place
(1);
26
publicclassMain{
StringBufferbf=newStringBuffer();
inti=Integer.parseInt(s[0]);
intn=Integer.parseInt(s[1]);
switch(i){
case0:
{
bf.append("
zero"
break;
case1:
one"
case2:
two"
case3:
three"
case4:
four"
case5:
five"
case6:
six"
case7:
seven"
case8:
eight"
case9:
nine"
case10:
ten"
case11:
eleven"
case12:
twelve"
case13:
thirteen"
case14:
fourteen"
case15:
fifteen"
case16:
sixteen"
case17:
seventeen"
case18:
eighteen"
case19:
nineteen"
case20:
twenty"
case21:
twentyone"
case22:
twentytwo"
case23:
twentythree"
if(n==0){
o'
clock"
elseif(n/10<
2){
switch(n){
one"
two"
three"
Zero"
five"
six"
seven"
eight"
nine"
ten"
eleven"
else{
switch(n/10){
thirty"
forty"
fifty"
switch(n%10){
four"
System.out.println(bf.toString());
25
/**
*@paramargs
*/
publicstaticvoidmain(String[]args)throwsIOException{
//TODOAuto-generatedmethodstub
BufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));
int[]nm=newint[2];
String[]s=br.readLine().split("
for(inti=0;
2;
i++){
nm[i]=Integer.parseInt(s[i]);
intm=nm[0],n=nm[1];
//System.out.println(n+"
+m);
int[][]arr=newint[m][n];
m;
Strings1=br.readLine();
String[]str=s1.split("
for(intj=0;
arr[i][j]=Integer.parseInt(str[j]);
intnum=n*m,brr=0;
inti=0,j=0,x=0,y=0,z=0;
for(intii=0;
ii<
num;
ii++){
n&
x<
m){
brr=arr[i][j];
if(i<
m-1){
i++;
x++;
elseif(j<
n-1&
i==m-1){
j++;
y++;
brr=arr[i][j];
elseif(j==y&
i>
z){
i--;
elseif(i==z&
j>
j--;
if(i==z&
j==z+1){
z++;
i++;
m=m-1;
n=n-1;
x=z;
y=z;
System.out.print(brr+"
24
publicstaticvoidmain(String[]args)throwsException{
BufferedReaderbf=newBufferedReader(newInputStreamReader(System.in));
Stringstr[]=bf.readLine().split("
intv1=Integer.parseInt(str[0]);
intv2=Integer.parseInt(str[1]);
intt=Integer.parseInt(str[2]);
ints=Integer.parseInt(str[3]);
intl=Integer.parseInt(str[4]);
intx=0,y=0,time=0;
for(inti=1;
=l;
if(x-y<
t){
x+=v1;
y+=v2;
else{
for(intj=1;
=s;
i=i+1;
if(y==l)
i=i-1;
if(x==l||y==l){
time=i;
if(y==l&
l)
System.out.println("
T"
if(x==l&
y<
R"
x==l)
D"
System.out.println(time);
23
BufferedReaderbf=newBufferedReader(newInputStreamReader(System.in));
intn=Integer.parseInt(bf.readLine());
inta[][]=newint[n][n];
intb[]=newint[n*n];
inti=0,j=0;
for(i=0;
Strings[]=bf.readLine().split("
for(j=0;
a[i][j]=Integer.parseInt(s[j]);
if(a[i][j]==0)
b[j]=b[j]+1;
if(b[i]<
=n/2)
System.out.print(i+1+"
22
*@throwsIOException
publicstaticvoidmain(String[]args)throwsIOException{
Strings=bf.readLine();
intn=Integer.parseInt(s);
Stringa="
A"
;
f(n,a,1);
privatestaticvoidf(intn,Stringa,inti){
if(n==i){
System.out.println(a);
return;
a=a+String.valueOf((char)(i+65))+a;
if(i==n){
System.out.println(a);
//while(i<
n)
f(n,a,i+1);
21
Scannerscanner=newScanner(System.in);
intn=scanner
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 蓝桥杯 练习系统 基础练习答案Java 练习 系统 基础 答案 Java