Created
July 17, 2016 13:47
-
-
Save Jack-Saleem/95013f5f1de64e2cc2ae39cda61e6eea to your computer and use it in GitHub Desktop.
codeforces 221A LittleElephantandFunction program in java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class LittleElephantandFunction | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
int n=z.nextInt(); | |
int[] a=new int[n]; | |
while(n>=1){ | |
a[n-1]=n; | |
n--; | |
} | |
int temp=0; | |
for(int x=a.length-1;x>0;x--) | |
{ | |
temp=a[x]; | |
a[x]=a[x-1]; | |
a[x-1]=temp; | |
} | |
for(int aa:a) | |
System.out.print(aa+" "); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment