原创 選擇排序

#include<stdio.h> int max(int a[],int len) { int maxid=0; int i=1; for(;i<len;i++ ) { if(a[i]>a[maxid]) { m

原创 多項式加法(5分)

一個多項式可以表達爲x的各次冪與係數乘積的和,比如: 2x6+3x5+12x3+6x+20 現在,你的程序要讀入兩個多項式,然後輸出這兩個多項式的和,也就是把對應的冪上的係數相加然後輸出。 程序要處理的冪最大爲100。   輸入格式: 總

原创 練習5-3 數字金字塔(15 分)

本題要求實現函數輸出n行數字金字塔。函數接口定義:void pyramid( int n ); 其中n是用戶傳入的參數,爲[1, 9]的正整數。要求函數按照如樣例所示的格式打印出n行數字金字塔。注意每個數字後面跟一個空格。#include

原创 正序分解整數

#include<stdio.h> /*int main() { int x; scanf("%d",&x); //x=13425; int t=0; do{ int d=x%10; t=t*10+

原创 練習2-3 輸出倒三角圖案

/*#include<stdio.h>int main(){  int i,j,count=4;  for(i=count;i>0;i--){  for(j=count-i;j>0;j--){  printf(" ");  } fo