close
Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中 
Subscribe to Bloomberg Businessweek

Get Bloomberg Businessweek for 84% off what others pay on the newsstand - that’s like getting 38 complimentary issues! Sign up today.
From our sponsors
c++ 程式題目的問題
Sep 6th 2013, 04:58

我做一個c++的題目:10002:Black Box
題目內容:
https://gpe2.acm-icpc.tw//domjudge2/pct/showproblemtab.php?probid=10002&cid=5

我的程式:

#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int n,m,i=0,d=0,o=0;
int a[0],b[0],c[0];
cin>>m;
cin>>n;
for(int j=0;j<m;j++)
{cin>>a[j];}

for(int j=0;j<n;j++)
{cin>>b[j];}

while(d<m)
{
c[d]=a[d];
if(d>0)
{
for(int j=0;j<=d+1;j++) //做排序
{
for(int k=j;k<=d;k++)
{
if(c[k]<c[j])
{
o=c[k];
c[k]=c[j];
c[j]=o;
}
}
}
}

if(b[i]==d+1)
{
m:
i++;
cout<<c[i-1]<<endl;
if(b[i-1]==b[i]&&b[i]!=NULL)
{
goto m;
}
}

d++;
}
system("PAUSE");
return EXIT_SUCCESS;
}

可是執行卻是run-error
source.cpp: In function 'int main(int, char**)':
source.cpp:41: warning: NULL used in arithmetic
source.cpp:49: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result
不太懂為什麼?

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends:

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 jmuko90 的頭像
    jmuko90

    2016【韓劇】奶酪陷阱劇情簡介及人物介紹奶酪陷阱 EP03 預告奶酪陷阱 線上看奶酪陷阱(捕鼠器裡的奶酪) 第1集

    jmuko90 發表在 痞客邦 留言(0) 人氣()