#include<bits/stdc++.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
ios::sync_with_stdio(false);
int x;
cin>>x;
int num[x];
for(int i=0;i<x;i++)
{
cin>>num[x];
}
sort(num,num+x);
for(int j=0;j<x;j++)
cout<<num[x];
cout<<endl;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
ios::sync_with_stdio(false);
int x;
cin>>x;
int num[x];
for(int i=0;i<x;i++)
{
cin>>num[x];
}
sort(num,num+x);
for(int j=0;j<x;j++)
cout<<num[x];
cout<<endl;
return 0;
}
把cin >> num[x] 改成cin >> num[i]
#include<bits/stdc++.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
ios::sync_with_stdio(false);
int x;
cin>>x;
int num[x];
for(int i=0;i<x;i++)
{
cin>>num[x];
}
sort(num,num+x);
for(int j=0;j<x;j++)
cout<<num[x];
cout<<endl;
return 0;
}
把cin >> num[x] 改成cin >> num[i]
還是NA沒辦法