最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

最近在學(xué)C語(yǔ)言,有段代碼一運(yùn)行就死機(jī),不知為何,求大神幫忙!

最近在學(xué)C語(yǔ)言,有段代碼一運(yùn)行就死機(jī),不知為何,求大神幫忙!

C
精慕門(mén)0776031 2017-06-23 19:05:35
#include <stdio.h>#define N 10//打印分?jǐn)?shù)int PScore(int score[]){? ? int i;? ? printf("\n");? ? for(i=0;i<N;i++)? ? {? ? ? ? printf("%d\n",score[i]);? ? }? ? printf("\n");}int JX(int score[]){? ? int i,j;? ? for(i=N-2;i>=0;i++)? ? {? ? ? ? for(j=0;j<=i;j++)? ? ? ? {? ? ? ? ? ? if(score[j]<score[j+1])? ? ? ? ? ? {? ? ? ? ? ? ? ? int temp;? ? ? ? ? ? ? ? temp=score[j];? ? ? ? ? ? ? ? score[j]=score[j+1];? ? ? ? ? ? ? ? score[j+1]=temp;? ? ? ? ? ? }? ? ? ? }? ? }? ? PScore(score);}int main(){? ? int score[N]={67,98,75,63,82,79,81,91,66,84};? ? printf("-----------成績(jī)排名---------\n");? ? JX(score);? ? return 0;}
查看完整描述

3 回答

已采納
?
qq_Serendipity_12

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超3個(gè)贊

???for(i=N-2;i>=0;i++)改成i--

查看完整回答
3 反對(duì) 回復(fù) 2017-06-23
?
新_day_day_new

TA貢獻(xiàn)18條經(jīng)驗(yàn) 獲得超6個(gè)贊

#include <stdio.h>
#define N 10
//打印分?jǐn)?shù)
int PScore(int score[])
{
??? int i;
??? printf("\n");
??? for(i=0;i<N;i++)
??? {
??????? printf("%d\n",score[i]);
??? }
??? printf("\n");
}
int JX(int score[])
{
??? int i,j;
??? for(i=N-2;i>=0;i--)
??? {
??????? for(j=0;j<=i;j++)
??????? {
??????????? if(score[j]<score[j+1])
??????????? {
??????????????? int temp;
??????????????? temp=score[j];
??????????????? score[j]=score[j+1];
??????????????? score[j+1]=temp;
??????????? }
??????? }
??? }
??? PScore(score);
}

int main()
{
??? int score[N]={67,98,75,63,82,79,81,91,66,84};
??? printf("-----------成績(jī)排名---------\n");
??? JX(score);
??? return 0;
}
改了一下jx函數(shù)的第一個(gè)for循環(huán)

查看完整回答
反對(duì) 回復(fù) 2017-06-24
?
xiao_xue

TA貢獻(xiàn)2條經(jīng)驗(yàn) 獲得超1個(gè)贊


目測(cè)確實(shí)沒(méi)添加返回值。

查看完整回答
反對(duì) 回復(fù) 2017-06-23
?
望遠(yuǎn)

TA貢獻(xiàn)1017條經(jīng)驗(yàn) 獲得超1032個(gè)贊

目測(cè)沒(méi)有什么問(wèn)題,但是你的JX函數(shù)和PScore函數(shù)沒(méi)有返回值。

查看完整回答
反對(duì) 回復(fù) 2017-06-23
點(diǎn)擊展開(kāi)后面1
  • 3 回答
  • 0 關(guān)注
  • 2080 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)