Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中 
Kindle Book Deals

We find the best deals on best-selling Kindle books for you. Just tell us which genres you love and we'll do the rest. The best part? It's completely free!
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
    全站熱搜
    創作者介紹
    創作者 kkoki0httzobg 的頭像
    kkoki0httzobg

    線上遊戲排行榜2013/2014,進擊的巨人線上看,candy crush saga外掛,正妹寫真三圍

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