#24603: 這樣為什麼還是NA


Aaaaaaaaaaaaa (羅傑)

學校 : 臺北市立大同高級中學
編號 : 69102
來源 : [111.235.208.242]
最後登入時間 :
2023-09-13 09:02:41
c431. Sort ! Sort ! Sort ! | From: [203.72.57.235] | 發表日期 : 2021-03-09 11:41

#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;

}

 
#24608: Re:這樣為什麼還是NA


fire5386 (becaidorz)

學校 : 國立清華大學
編號 : 115822
來源 : [59.115.180.44]
最後登入時間 :
2024-05-03 16:46:17
c431. Sort ! Sort ! Sort ! | From: [61.230.2.20] | 發表日期 : 2021-03-09 21:43

#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]

 
#24702: Re:這樣為什麼還是NA


Aaaaaaaaaaaaa (羅傑)

學校 : 臺北市立大同高級中學
編號 : 69102
來源 : [111.235.208.242]
最後登入時間 :
2023-09-13 09:02:41
c431. Sort ! Sort ! Sort ! | From: [203.72.57.235] | 發表日期 : 2021-03-16 11:34

#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沒辦法

 
ZeroJudge Forum