天梯赛L1 题解

L1-001 Hello World (5 分)

这道超级简单的题目没有任何输入。

你只需要在一行中输出著名短句“Hello World!”就可以了。

AC代码:(直接输出记性)

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn=10005;
int main()
{
    printf("Hello World!\n");
    return 0;
}
L1-002 打印沙漏 (20 分)

本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印

*****
 ***
  *
 ***
*****

所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号数相等。

给定任意N个符号,不一定能正好组成一个沙漏。要求打印出的沙漏能用掉尽可能多的符号。

输入样例:

19 *

输出样例:

*****
 ***
  *
 ***
*****
2

解法:我们先求出共有多少层,然后根据层数输出。
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n;
char c;
int main()
{
    scanf("%d %c",&n,&c);
    int sum=1,i=1;//i代表几层,sum代表沙漏需要的字符个数
    while(sum<=n)
    {
        sum+=2*(2*(i+1)-1);
        if(sum<=n)
            i++;
    }
//    cout<<i<<endl;
    for(int j=0;j<i;j++)
    {
        for(int k=0;k<j;k++)
            printf(" ");
        for(int k=0;k<(2*(i-j)-1);k++)
            printf("%c",c);
        printf("\n");
    }
    for(int j=2;j<=i;j++)
    {
        for(int k=0;k<i-j;k++)
            printf(" ");
        for(int k=0;k<(2*j-1);k++)
            printf("%c",c);
        printf("\n");
    }
    printf("%d",n-(sum-2*(2*(i+1)-1)));
    return 0;
}
L1-003 个位数统计 (15 分)

给定一个 k 位整数 1 (0, ,, dk1​​>0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 0,则有 2 个 0,3 个 1,和 1 个 3。

输入样例:

100311

输出样例:

0:2
1:3
3:1
解法:用数组模拟,a[i] 表示数字 i 出现几次

AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn=10005;
string s;
int a[15];
int main()
{
    memset(a,0,sizeof(a));
    cin>>s;
    int len=s.length();
    for(int i=0;i<len;i++)
    {
        a[s[i]-'0']++;
    }
    for(int i=0;i<10;i++)
    {
        if(a[i]!=0)
            printf("%d:%d\n",i,a[i]);
    }
    return 0;
}
L1-004 计算摄氏温度 (5 分)

给定一个华氏温度F,本题要求编写程序,计算对应的摄氏温度C。计算公式:2。题目保证输入与输出均在整型范围内。

输入样例:

150

输出样例:

Celsius = 65
解法:简单数学计算
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn=10005;
int F;
int main()
{
    cin>>F;
    cout<<"Celsius = "<<5*(F-32)/9<<endl;
    return 0;
}
L1-005 考试座位号 (15 分)

每个 PAT 考生在参加考试时都会被分配两个座位号,一个是试机座位,一个是考试座位。正常情况下,考生在入场时先得到试机座位号码,入座进入试机状态后,系统会显示该考生的考试座位号码,考试时考生需要换到考试座位就座。但有些考生迟到了,试机已经结束,他们只能拿着领到的试机座位号码求助于你,从后台查出他们的考试座位号码。

输入样例:

4
3310120150912233 2 4
3310120150912119 4 1
3310120150912126 1 3
3310120150912002 3 2
2
3 4

输出样例:

3310120150912002 2
3310120150912119 1
解法:用map 存储,然后在map中对应输出就行了

AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
map<int,string>ma1;
map<int,int>ma2;
int main()
{
    string s;int a,b;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>s>>a>>b;
        ma1[a]=s;
        ma2[a]=b;
    }
    cin>>m;
    int x;
    for(int i=1;i<=m;i++)
    {
        cin>>x;
        cout<<ma1[x]<<" "<<ma2[x]<<endl;
    }
    return 0;
}
L1-006 连续因子 (20 分)

一个正整数 N 的因子中可能存在若干连续的数字。例如 630 可以分解为 3×5×6×7,其中 5、6、7 就是 3 个连续的数字。给定任一正整数 N,要求编写程序求出最长连续因子的个数,并输出最小的连续因子序列。

输入样例:

630

输出样例:

3
5*6*7
解法:
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,N;
map<int,string>ma;
int main()
{
    scanf("%d",&N);
    int n=sqrt(N);
    LL sum;
    int i,j;
    for(int len=11;len>=1;len--)
    {
        for(i=2;i<=n;i++)
        {
            sum=1;
            for(j=i;j<=len-1+i;j++)
            {
                sum*=j;
                if(sum>N)
                    break;
            }
            if(N%sum==0)
            {
                printf("%d\n%d",len,i);
                for(int k=i+1;k<j;k++)
                    printf("*%d",k);
                printf("\n");
                return 0;
            }
        }
    }
    printf("1\n%d\n",N);
    return 0;
}

 

L1-007 念数字 (10 分)

输入一个整数,输出每个数字对应的拼音。当整数为负数时,先输出fu字。十个数字对应的拼音如下:

0: ling
1: yi
2: er
3: san
4: si
5: wu
6: liu
7: qi
8: ba
9: jiu

输入样例:

-600

输出样例:

fu liu ling ling
解法:利用map存储再输出就可以了。
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
map<int,string>ma;
int main()
{
    ma[0]="ling";
    ma[1]="yi";
    ma[2]="er";
    ma[3]="san";
    ma[4]="si";
    ma[5]="wu";
    ma[6]="liu";
    ma[7]="qi";
    ma[8]="ba";
    ma[9]="jiu";
    string s;
    cin>>s;
    int len=s.length();
    int i=0;
    if(s[0]=='-')
    {
        cout<<"fu ";
        i++;
    }
    for(;i<len-1;i++)
    {
        cout<<ma[s[i]-'0']<<" ";
    }
    cout<<ma[s[i]-'0'];
    cout<<endl;
    return 0;
}
L1-008 求整数段和 (10 分)

给定两个整数A和B,输出从A到B的所有整数以及这些数的和。

输入样例:

-3 8

输出样例:

   -3   -2   -1    0    1
    2    3    4    5    6
    7    8
Sum = 30
解法:模拟即可
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    int sum=0,t=0;
    for(int i=a;i<=b;i++)
    {
        sum+=i;
        printf("%5d",i);
        t++;
        if(t%5==0&&i!=b)
        {
            printf("\n");
            t=0;
        }
    }
    printf("\n");
    printf("Sum = %d\n",sum);
    return 0;
}
L1-010 比较大小 (10 分)

本题要求将输入的任意3个整数从小到大输出。

输入样例:

4 2 8

输出样例:

2->4->8
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int a[5];
int main()
{
    for(int i=0;i<3;i++)
        scanf("%d",&a[i]);
    sort(a,a+3);
    for(int i=0;i<2;i++)
        printf("%d->",a[i]);
    printf("%d\n",a[2]);
    return 0;
}
L1-011 A-B (20 分)

本题要求你计算AB。不过麻烦的是,A和B都是字符串 —— 即从字符串A中把字符串B所包含的字符全删掉,剩下的字符组成的就是字符串AB。

输入样例:

I love GPLT!  It's a fun game!
aeiou

输出样例:

I lv GPLT!  It's  fn gm!
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
string s1,s2;
set<char>s;
int main()
{
    getline(cin,s1);
    getline(cin,s2);
    int len=s2.length();
    for(int i=0;i<len;i++)
        s.insert(s2[i]);
    len=s1.length();
    for(int i=0;i<len;i++)
    {
        if(s.count(s1[i])==0)
            cout<<s1[i];
    }
    cout<<endl;
    return 0;
}
L1-012 计算指数 (5 分)

真的没骗你,这道才是简单题 —— 对任意给定的不超过 10 的正整数 n,要求你输出 2n​​。不难吧?

输入样例:

5

输出样例:

2^5 = 32
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int main()
{
    scanf("%d",&n);
    int t=pow(2,n);
    printf("2^%d = %d",n,t);
    return 0;
}
L1-013 计算阶乘和 (10 分)

对于给定的正整数N,需要你计算 S=1!+2!+3!+...+N!

输入样例:

3

输出样例:

9
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int a[15];
int main()
{
    a[1]=1;
    a[2]=2;
    for(int i=3;i<=10;i++)
        a[i]=i*a[i-1];
    scanf("%d",&n);
    int ans=0;
    for(int i=1;i<=n;i++)
        ans+=a[i];
    printf("%d\n",ans);
    return 0;
}
L1-014 简单题 (5 分)

这次真的没骗你 —— 这道超级简单的题目没有任何输入。

输入样例:

输出样例:

This is a simple problem.

你只需要在一行中输出事实:This is a simple problem. 就可以了。

AC代码:

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int a[15];
int main()
{
    printf("This is a simple problem.\n");
    return 0;
}
L1-015 跟奥巴马一起画方块 (15 分)

美国总统奥巴马不仅呼吁所有人都学习编程,甚至以身作则编写代码,成为美国历史上首位编写计算机代码的总统。2014年底,为庆祝“计算机科学教育周”正式启动,奥巴马编写了很简单的计算机代码:

在屏幕上画一个正方形。现在你也跟他一起画吧!

输入样例:

10 a

输出样例:

aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
aaaaaaaaaa
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
char s;
int main()
{
    scanf("%d %c",&n,&s);
    for(int i=1;i<=(int)(n/2.0+0.5);i++)
    {
        for(int j=1;j<=n;j++)
            printf("%c",s);
        printf("\n");
    }
    return 0;
}
L1-016 查验身份证 (15 分)

一个合法的身份证号码由17位地区、日期编号和顺序编号加1位校验码组成。校验码的计算规则如下:

首先对前17位数字加权求和,权重分配为:{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};然后将计算的和对11取模得到值Z;最后按照以下关系对应Z值与校验码M的值:

Z:0 1 2 3 4 5 6 7 8 9 10
M:1 0 X 9 8 7 6 5 4 3 2

现在给定一些身份证号码,请你验证校验码的有效性,并输出有问题的号码。

输入样例1:

4
320124198808240056
12010X198901011234
110108196711301866
37070419881216001X

输出样例1:

12010X198901011234
110108196711301866
37070419881216001X
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=105;
int n,m;
char s[maxn];
int h[17]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
char c[11]={'1','0','X','9','8','7','6','5','4','3','2'};
int main()
{
    bool flag1=false;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%s",s);
        int sum=0;
        bool flag2=false;
        for(int i=0;i<17;i++)
        {
            if(s[i]>='0'&&s[i]<='9')
                sum+=((s[i]-'0')*h[i]);
            else
            {
                flag2=true;
                break;
            }
        }
//        cout<<sum%11<<endl;
        if(flag2 || (s[17]!=c[sum%11]))
        {
            printf("%s\n",s);
            flag1=true;
        }
    }
    if(flag1==false)
        printf("All passed\n");
    return 0;
}
L1-017 到底有多二 (15 分)

一个整数“犯二的程度”定义为该数字中包含2的个数与其位数的比值。如果这个数是负数,则程度增加0.5倍;如果还是个偶数,则再增加1倍。例如数字-13142223336是个11位数,

其中有3个2,并且是负数,也是偶数,则它的犯二程度计算为:3,约为81.82%。本题就请你计算一个给定整数到底有多二。

输入样例:

-13142223336

输出样例:

81.82%
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=105;
int n,m;
string s;
int main()
{
    double ans=1.0;
    cin>>s;
    int len=s.length();
    int i=0;int cnt2=0;
    if((s[len-1]-'0')%2==0)
        ans*=2;
    if(s[i]=='-')
    {
        ans*=1.5;
        i++;
        len--;
    }
    for(;i<len;i++)
    {
        if(s[i]=='2')
            cnt2++;
    }
//    cout<<cnt2<<" "<<len<<endl;
//    double temp=cnt2*1.0/len;
//    cout<<temp<<endl;
    ans=ans*(cnt2*1.0/len);
    printf("%.2f",ans*100);
    cout<<"%"<<endl;
    return 0;
}
L1-018 大笨钟 (10 分)

微博上有个自称“大笨钟V”的家伙,每天敲钟催促码农们爱惜身体早点睡觉。不过由于笨钟自己作息也不是很规律,所以敲钟并不定时。一般敲钟的点数是根据敲钟时间而定的,如果正好在某个整点敲,那么“当”数就等于那个整点数;如果过了整点,就敲下一个整点数。另外,虽然一天有24小时,钟却是只在后半天敲1~12下。例如在23:00敲钟,就是“当当当当当当当当当当当”,而到了23:01就会是“当当当当当当当当当当当当”。在午夜00:00到中午12:00期间(端点时间包括在内),笨钟是不敲的。

下面就请你写个程序,根据当前时间替大笨钟敲钟。

输入样例1:

19:05

输出样例1:

DangDangDangDangDangDangDangDang
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=105;
int n,m;
string s;
int main()
{
    int h,m;
    scanf("%d:%d",&h,&m);
    if((h==12&&m>0)||(h>12&&h<24))
    {
        h-=12;
        if(m>0)
            h++;
        for(int i=0;i<h;i++)
            printf("Dang");
         printf("\n");
    }
    else
    {
        if(h==24)
            h=0;
        printf("Only %02d:%02d.  Too early to Dang.\n",h,m);
    }
    return 0;
}
L1-019 谁先倒 (15 分)

划拳是古老中国酒文化的一个有趣的组成部分。酒桌上两人划拳的方法为:每人口中喊出一个数字,同时用手比划出一个数字。如果谁比划出的数字正好等于两人喊出的数字之和,谁就输了,输家罚一杯酒。两人同赢或两人同输则继续下一轮,直到唯一的赢家出现。

下面给出甲、乙两人的酒量(最多能喝多少杯不倒)和划拳记录,请你判断两个人谁先倒。

输入样例:

1 1
6
8 10 9 12
5 10 5 10
3 8 5 12
12 18 1 13
4 16 12 15
15 1 1 16

输出样例:

A
1
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
using namespace std;
typedef long long LL;
const int maxn=105;
int x,y;
int n;
int main()
{
    scanf("%d %d",&x,&y);
    scanf("%d",&n);
    int a[maxn];
    int b[maxn];
    int c[maxn];
    int d[maxn];
    int cnt1=0,cnt2=0;
    for(int i=1;i<=n;i++)
        scanf("%d %d %d %d",&a[i],&b[i],&c[i],&d[i]);
    bool flag1=false,flag2=false;
    for(int i=1;i<=n;i++)
    {
        if(b[i]==a[i]+c[i]&&d[i]!=a[i]+c[i])
            cnt1++;
        if(d[i]==a[i]+c[i]&&b[i]!=a[i]+c[i])
            cnt2++;
        if(cnt1>x)
        {
            flag1=true;
            break;
        }
        if(cnt2>y)
        {
            flag2=true;
            break;
        }
    }
    if(flag1)
        printf("A\n%d\n",cnt2);
    if(flag2)
        printf("B\n%d\n",cnt1);
    return 0;
}
L1-021 重要的话说三遍 (5 分)

这道超级简单的题目没有任何输入。

你只需要把这句很重要的话 —— “I'm gonna WIN!”——连续输出三遍就可以了。

注意每遍占一行,除了每行的回车不能有任何多余字符。

输入样例:

输出样例:

I'm gonna WIN!
I'm gonna WIN!
I'm gonna WIN!
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int main()
{
    printf("I'm gonna WIN!\n");
    printf("I'm gonna WIN!\n");
    printf("I'm gonna WIN!\n");
    return 0;
}
L1-022 奇偶分家 (10 分)

给定N个正整数,请统计奇数和偶数各有多少个?

输入样例:

9
88 74 101 26 15 0 34 22 77

输出样例:

3 6
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int main()
{
    scanf("%d",&n);
    int cnt1=0,cnt2=0;
    while(n--)
    {
        int x;
        scanf("%d",&x);
        if(x%2)
            cnt1++;
        else
            cnt2++;
    }
    printf("%d %d\n",cnt1,cnt2);
    return 0;
}
L1-023 输出GPLT (20 分)

给定一个长度不超过10000的、仅由英文字母构成的字符串。请将字符重新调整顺序,按GPLTGPLT....这样的顺序输出,并忽略其它字符。当然,四种字符(不区分大小写)的个数不一定是一样多的,

若某种字符已经输出完,则余下的字符仍按GPLT的顺序打印,直到所有字符都被输出。

输入样例:

pcTclnGloRgLrtLhgljkLhGFauPewSKgt

输出样例:

GPLTGPLTGLTGLGLL
AC代码:

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int main()
{
string s;
cin>>s;
int len=s.length();
int cnt1=0,cnt2=0,cnt3=0,cnt4=0;
for(int i=0;i<len;i++)
{
if(s[i]=='G'||s[i]=='g')
cnt1++;
if(s[i]=='P'||s[i]=='p')
cnt2++;
if(s[i]=='L'||s[i]=='l')
cnt3++;
if(s[i]=='T'||s[i]=='t')
cnt4++;
}
while(cnt1>0 || cnt2>0 || cnt3>0 ||cnt4>0)
{
if(cnt1>0)
{
printf("G");
cnt1--;
}
if(cnt2>0)
{
printf("P");
cnt2--;
}
if(cnt3>0)
{
printf("L");
cnt3--;
}
if(cnt4>0)
{
printf("T");
cnt4--;
}
}
printf("\n");
return 0;
}

L1-024 后天 (5 分)

如果今天是星期三,后天就是星期五;如果今天是星期六,后天就是星期一。我们用数字1到7对应星期一到星期日。给定某一天,请你输出那天的“后天”是星期几

输入样例:

3

输出样例:

5
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int main()
{
    int n;
    scanf("%d",&n);
    n=n+2;
    if(n<=7)
        printf("%d\n",n);
    else
        printf("%d\n",n-7);
    return 0;
}
L1-026 I Love GPLT (5 分)

这道超级简单的题目没有任何输入。

你只需要把这句很重要的话 —— “I Love GPLT”——竖着输出就可以了。

所谓“竖着输出”,是指每个字符占一行(包括空格),即每行只能有1个字符和回车。

输入样例:

输出样例:

I

L
o
v
e

G
P
L
T
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
const int maxn=10005;
int n,m;
int main()
{
    printf("I\n");
    printf(" \n");
    printf("L\n");
    printf("o\n");
    printf("v\n");
    printf("e\n");
    printf(" \n");
    printf("G\n");
    printf("P\n");
    printf("L\n");
    printf("T");
    return 0;
}
L1-027 出租 (20 分)

下面是新浪微博上曾经很火的一张图:

一时间网上一片求救声,急问这个怎么破。其实这段代码很简单,index数组就是arr数组的下标,index[0]=2 对应 arr[2]=1index[1]=0 对应 arr[0]=8index[2]=3 对应 arr[3]=0,以此类推…… 很容易得到电话号码是18013820100

本题要求你编写一个程序,为任何一个电话号码生成这段代码 —— 事实上,只要生成最前面两行就可以了,后面内容是不变的。

输入样例:

18013820100

输出样例:

int[] arr = new int[]{8,3,2,1,0};
int[] index = new int[]{3,0,4,3,1,0,2,4,3,4,4};
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn=15;
int n,m;
char a[maxn];
int arr[maxn];
int indexx[maxn];
int main()
{
    scanf("%s",a);
    int k=0;
    for(int i=9;i>=0;i--)
    {
        bool flag=false;
        for(int j=0;j<11;j++)
        {
            if(i==a[j]-'0')
            {
                arr[k]=i;
                indexx[j]=k;
                flag=true;
            }
        }
        if(flag)
            k++;
    }
//    cout<<1<<endl;
    printf("int[] arr = new int[]{");
    for(int i=0;i<k;i++)
    {
        printf("%d",arr[i]);
        if(i!=k-1)
            printf(",");
    }
    printf("};\n");

    printf("int[] index = new int[]{");
    for(int i=0;i<11;i++)
    {
        printf("%d",indexx[i]);
        if(i!=10)
            printf(",");
    }
    printf("};\n");
    return 0;
}

 

posted @ 2019-03-28 15:00  从让帝到the_rang  阅读(624)  评论(0编辑  收藏  举报