SHARE
TWEET

Untitled

a guest Dec 11th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5.     char *s;
  6.     printf("%d\n",argc);
  7.     for(int i=1 ; i<argc-1 ; i++)
  8.     {
  9.     for(int j=i+1 ; j<argc ; j++)
  10.         {
  11.         if(argv[j][0]=='-')
  12.             {
  13.             s=argv[i];
  14.             argv[i]=argv[j];
  15.             argv[j]=s;
  16.             }
  17.         }
  18.     }
  19.     for(int i=0 ; i<argc ; i++)
  20.     {
  21.         printf("%10s\n",argv[i]);
  22.     }
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top