点击这里更换您喜欢的皮肤wtboj 首页
请点击这里登入noios   首页 入门 c++讲义 入门教程视频 金牌教程 入门视频 站务 公告 | 题库 记录 竞测 测试 闯关 作业 排名 团队 讨论 | 换肤 | 登入 注册  
News >>   新增功能:各团队管理员可以发布本团队作业了 ()

From VijosGuest0
螺旋弯
背景 Background
  为了for beginngers,特设此题,^_^
描述 Description
  提交文件:turn.pas/turn.exe
输入文件:turn.in
输出文件:turn.out
问题描述:
螺旋弯是由数字和连线按照顺时针方向画出的图形,如下图所示:

在拐弯时不能与已画出的图形发生碰撞,并且能拐弯时就一定要拐。由图可知,前4次拐弯分别发生在数字2、3、5、7这4个位置。
输入N,计算第N次拐弯发生在哪个数字处?
17 18 19 20 21
16  5  6  7 22
15  4  1  8 23
14  3  2  9 24
13 12 11 10 25
  ..... 27 26
输入格式:
  输入只有一行,包括一个整数N (1<=N<=100000)
输出格式:
  输出第N个弯处的数字。
输入样例:(turn.in)
5
输出样例:(turn.out)
10
输入格式 Input Format
  输入只有一行,包括一个整数N (1<=N<=100000)
输出格式 Output Format
  输出第N个弯处的数字。
样例输入 Sample Input
 
样例输出 Sample Output
 
时间限制 Time Limitation
  各个测试点1s
注释 Hint
  Free Pascal Code:
-------------------
program Plus;
var a,b:longint;
begin
 readln(a,b);
 writeln(a+b);
end.

C++ Code:
-------------------
#include <iostream>
using namespace std;
int main(){
 int a,b;
 cin>>a>>b;
 cout<<a+b<<endl;
 return 0;
}
Flag
  
题号
  P1091
  其它
通过
  47人
提交
  124次
通过率
  38%
难度
  0
提交 讨论 题解
 Copyright wtboj © 2005-2006. www.wutuobang.date Powered by wtboj 关于 联系 帮助
 wtboj Information ---- Total Users : 1253 | Online Users / Processes : 0 / 29 | Processed Time : 31 ms | Server Time : 2025/7/1 10:55:51