#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int i,ans;
cin>>i;
string a[i];
int b[i];
for(int j=0 ; j<i ; j++) {
cin>>a[i];
reverse(a[i].begin(), a[i].end());
b[i]=stoll(a[i]);
ans=b[0];
if(ans<=b[i]) ans=b[i];
}
cout<<ans<<endl;
return 0;
}
#include
#include
using namespace std;
int main()
{
int i,ans;
cin>>i;
string a[i];
int b[i];
for(int j=0 ; j
cin>>a[i];
reverse(a[i].begin(), a[i].end());
b[i]=stoll(a[i]);
ans=b[0];
if(ans<=b[i]) ans=b[i];
}
cout<<ans<<endl;
return 0;
}
1. 迴圈裡面i改成j
2. ans=b[0]不要放迴圈裡面