射手的博客
学习Delphi,需要一个记录学习的博客,

导航

<2010年5月>
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
统计
  • 随笔 - 24
  • 文章 - 0
  • 评论 - 3
  • 引用 - 0

常用链接

留言簿(1)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 
#include <cstdlib>
#include 
<iostream>
    
using namespace std;

int main(int argc, char *argv[])
{   
    
int score[5],*PointerScore = score;
    
int i,j,temp;
    
for(i=0;i<5;i++)
     scanf(
"%d",&score[i]);
    
for(i=0;i<5;i++)
     
for(j=i+1;j<5;j++)
      
if  (* (PointerScore+i) < *(PointerScore+j) )
       
{
         temp 
= *(PointerScore+j);
        
*(PointerScore+j) = *(PointerScore+i);
        
*(PointerScore+i) = temp;
        }

         printf(
"排列:");
    
for(i=0;i<5;i++)
     printf(
"%d \n",score[i]);    
    system(
"PAUSE");
    
return EXIT_SUCCESS;
}

posted on 2009-05-19 23:51 Archer 阅读(218) 评论(0)  编辑 收藏 引用 所属分类: C语言的学习
只有注册用户登录后才能发表评论。