#17799: 一直RE


fdhs_108OuOb (白熊ʕ •ᴥ•ʔ)

學校 : 桃園市私立復旦高級中學
編號 : 84135
來源 : [114.25.211.92]
最後登入時間 :
2023-10-22 00:55:38
c381. 聖經密碼 -- 板橋高中教學題 | From: [118.161.109.98] | 發表日期 : 2019-05-22 09:21

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,q=0;
string a,b,c;
while(cin>>n>>m)
{
if(n!=m)
{
for(int i=1;i<=n;i++)
{
cin>>a;
b=b+a;
}
for(int o=1;o<=m;o++)
{
cin>>c[q];
q++;
}
for(int w=0;w<=m;w++)
{
cout<<b.at(c[w]);
}
cout<<endl;
}
else
break;
}
return 0;
}

 

系統呼叫了 abort 函式!
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 51) >= this->size() (which is 35)
Aborted (core dumped)


:P
 
ZeroJudge Forum