#14621: 無法輸入 可以幫忙修改嗎 非常感謝!!


fionahung0908 (username)


#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <stdio.h>
#include <algorithm>
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) {
int x;
while(scanf("%d",x))
{
int num[x];
for(int i=0;i<x;i++)
{
scanf("%d",&num[x]);
}
sort(num,num+x);
for(int j=0;j<x;j++)
printf("%d ",num[x]);
printf("\n");
}
return 0;
}

#14626: Re:無法輸入 可以幫忙修改嗎 非常感謝!!


kev8067@gmail.com (卓承緯)


#include
#include
#include
#include
#include
#include
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) {
int x;
while(scanf("%d",x))
{
int num[x];
for(int i=0;i<x;i++)
{
scanf("%d",&num[x]);
}
sort(num,num+x);
for(int j=0;j<x;j++)
printf("%d ",num[x]);
printf("\n");
}
return 0;
}


單筆輸入~~

#14650: Re:無法輸入 可以幫忙修改嗎 非常感謝!!


kev8067@gmail.com (卓承緯)


#include
#include
#include
#include
#include
#include
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) {
int x;
while(scanf("%d",x))
{
int num[x];
for(int i=0;i<x;i++)
{
scanf("%d",&num[x]);
}
sort(num,num+x);
for(int j=0;j<x;j++)
printf("%d ",num[x]);
printf("\n");
}
return 0;
}


單筆輸入~~

順便在補一下


本題記憶體限制 5 MB
請勿使用   #include <iostream>
請使用 #include <stdio.h> 使用 scanf , printf 輸入輸出