Login
Immutable PageDiscussionInfoAttachments
rei05/C言語/10028

MMA

   1 #include<stdio.h>
   2 int main(){
   3  
   4 int n,i,j,k,l,temp;
   5 scanf("%d",&n);
   6  
   7 int num[n];
   8 for(i=0;i<n;i++){
   9   scanf("%d",&num[i]);
  10 }
  11  
  12 for(j=0;j<n;j++){
  13   for(k=0;k<n;k++){
  14     if(num[j]<num[k]){
  15       temp=num[j];
  16       num[j]=num[k];
  17       num[k]=temp;
  18     }
  19   }
  20 }
  21  
  22 for(l=0;l<n-1;l++){
  23   printf("%d ",num[l]);
  24 }
  25 printf("%d\n",num[n-1]);
  26  
  27 return(0);
  28 }

rei05/C言語/10028 (last edited 2012-05-29 17:00:02 by rei05)