delete pics to save space
This commit is contained in:
32
history_source/ccf 入门篇/U4/4.3.5.cpp
Normal file
32
history_source/ccf 入门篇/U4/4.3.5.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include<cstdio>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int x=1,y=1,n;
|
||||
scanf("%d",&n);
|
||||
bool f=1;
|
||||
for(int i=1;i<n;i++)
|
||||
{
|
||||
if(f)
|
||||
{
|
||||
if(y>1) y--,x++;
|
||||
else
|
||||
{
|
||||
f=0;
|
||||
x++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(x>1) x--,y++;
|
||||
else
|
||||
{
|
||||
f=1;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%d/%d\n",y,x);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user