/*
#include<stdio.h>
typedef struct
{
int n1,s1,s2;
} s;
int main()
{
s st[1001],temp;
int n,i,j;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
scanf("%d %d",&st[i].s1,&st[i].s2);
st[i].n1=i;
}
for(i=1; i<n; i++)
{
for(j=1; j<=n-i; j++)
{
if(st[j].s1<st[j+1].s1)
{
temp=st[j];
st[j]=st[j+1];
st[j+1]=temp;
}
else if(st[j].s1==st[j+1].s1)
{
if(st[j].s2<st[j+1].s2)
{
temp=st[j];
st[j]=st[j+1];
st[j+1]=temp;
}
else if(st[j].s2==st[j+1].s2)
{
if(st[j].n1>st[j+1].n1)
{
temp=st[j];
st[j]=st[j+1];
st[j+1]=temp;
}
}
}
}
}
for(i=1;i<=n;i++)
{
printf("%d %d %d\n",st[i].n1,st[i].s1,st[i].s2);
}
return 0;
}
f(n) : *을 n번 출력
*을 출력 --> *을 n-1 번 출력
*출력 --> f(n-1)
#include <stdio.h>
void f(int n)
{
if(n==0) return ;
printf("*");
f(n-1);
}
int main()
{
f(3);
printf("hello world");
f(5);
return 0;
}
f(n) : n부터 1까지 출력
n출력 --> n-1부터 1까지 출력
n출력 --> f(n-1)
#include<stdio.h>
void f(int n)
{
if(n==0) return ;
printf("%d\n",n);
f(n-1);
}
int main()
{
int n;
scanf("%d",&n);
f(n);
}
#include<stdio.h>
void f(int n)
{
if(n==0) return ;
f(n-1);
printf("%d\n",n);
}
int main()
{
int n;
scanf("%d",&n);
f(n);
}
f(n) : 1부터 n까지 출력
1부터 n-1까지 출력 --> n출력
f(n-1)--> n출력
f(a,b) : a부터 b까지 출력
a부터 b-1까지 출력 --> b출력
f(a,b-1)--> b출력
#include<stdio.h>
void f(int a,int b)
{
if(a>b) return ;
f(a,b-1);
if(b%2==1) printf("%d ",b);
}
int main()
{
int a,b;
scanf("%d %d",&a,&b);
f(a,b);
}
#include <stdio.h>
void f(int n)
{
printf("%d\n",n);
if(n==1) return ;
if(n%2==1)
{
f(3*n+1);
}
else
{
f(n/2);
}
}
int main()
{
int n;
scanf("%d",&n);
f(n);
}
*/