蓝桥杯每日一题2023.12.5

题目描述

1.一步之遥 - 蓝桥云课 (lanqiao.cn)

题目分析 

对于本题遵循多了就减少了就加的原则,用while进行计算即可

#include<bits/stdc++.h>
using namespace std;
int x, ans;
int main()
{
	while(x != 1)
	{
		if(x < 1)x += 97;
		else x -= 127;
		ans ++;
	}
	cout << ans;
	return 0;
}

相关推荐

  1. 每日(python)

    2023-12-06 08:22:01       62 阅读
  2. 每日(BFS)

    2023-12-06 08:22:01       41 阅读
  3. 每日(dfs)

    2023-12-06 08:22:01       50 阅读
  4. 每日:扫雷

    2023-12-06 08:22:01       42 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-06 08:22:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-06 08:22:01       106 阅读
  3. 在Django里面运行非项目文件

    2023-12-06 08:22:01       87 阅读
  4. Python语言-面向对象

    2023-12-06 08:22:01       96 阅读

热门阅读

  1. 算法基础之八数码

    2023-12-06 08:22:01       53 阅读
  2. RPC基础

    RPC基础

    2023-12-06 08:22:01      66 阅读
  3. ZooKeeper常见面试题

    2023-12-06 08:22:01       60 阅读
  4. 173. 矩阵距离(多源BFS)

    2023-12-06 08:22:01       58 阅读
  5. 解决 IIS HTTP 403 错误问题

    2023-12-06 08:22:01       60 阅读
  6. [英语学习][8][Word Power Made Easy]的精读与翻译优化

    2023-12-06 08:22:01       50 阅读
  7. 记录 | CUDA编程中用constexpr替代__host__&__device__

    2023-12-06 08:22:01       55 阅读