Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n, i;
- scanf("%d",&n);
- if(n<20)
- {
- printf("Too Small\n");
- }
- else
- {
- if(n%2==0)
- {
- for(i=n-1; i>0; i-=2)
- {
- if(i==1)
- {
- printf("%d\n", i);
- }
- else
- {
- printf("%d-", i);
- }
- }
- }
- else
- {
- for(i=n; i>0; i-=2)
- {
- if(i==1)
- {
- printf("%d\n", i);
- }
- else
- {
- printf("%d-", i);
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement