L1 027 出租 20分 C語言)

2021-10-23 09:43:12 字數 1034 閱讀 7281

一時間網上一片求救聲,急問這個怎麼破。其實這段**很簡單,index陣列就是arr陣列的下標,index[0]=2 對應 arr[2]=1,index[1]=0 對應 arr[0]=8,index[2]=3 對應 arr[3]=0,以此類推…… 很容易得到**號碼是18013820100。

本題要求你編寫乙個程式,為任何乙個**號碼生成這段** —— 事實上,只要生成最前面兩行就可以了,後面內容是不變的。

輸入格式:

輸入在一行中給出乙個由11位數字組成的手機號碼。

輸出格式:

為輸入的號碼生成**的前兩行,其中arr中的數字必須按遞減順序給出。

輸入樣例:

18013820100
輸出樣例:

int arr = new int;

int index = new int;

#include

int main()

for(i=

0;i<

11;i++)if

(max

) max=number[i]

; temp=max;

arr[0]

=temp;

for(i=

0;i<

11;i++

) arr[i+1]

=max;

temp=max;

}printf

("int arr = new int

}printf

("};\n");

printf

("int index = new int

for(i=

1;i<

11;i++)}

printf

("};");

return0;

}

C語言 L1 027 出租 (20 分)

輸出樣例 int arr new int int index new int 思路 建立兩個陣列,arr陣列儲存 號碼 現的數字且按降序,index儲存 號碼的每一位數字在arr陣列中的位置 include intmain 判斷是否讀入過此數字 for int i 0 i 11 i a tell i...

L1 027 出租 20分 C語言

一時間網上一片求救聲,急問這個怎麼破。其實這段 很簡單,index陣列就是arr陣列的下標,index 0 2 對應 arr 2 1,index 1 0 對應 arr 0 8,index 2 3 對應 arr 3 0,以此類推 很容易得到 號碼是18013820100。本題要求你編寫乙個程式,為任何...

L1 027 出租 20分 (C語言)

一時間網上一片求救聲,急問這個怎麼破。其實這段 很簡單,index陣列就是arr陣列的下標,index 0 2 對應 arr 2 1,index 1 0 對應 arr 0 8,index 2 3 對應 arr 3 0,以此類推 很容易得到 號碼是18013820100。本題要求你編寫乙個程式,為任何...