大哥们 帮个忙把 谢谢!

bigboy130 2004-04-30 06:29:38
Being given the positive integer 1 < K <= 10^4 you are to find a minimal positive integer N such that if you get the N's first (major) decimal digit away and append it to the end of the rest of N's decimal representation you will get an integer, which is K times less than N.


This problem contains multiple test cases!

The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.

The output format consists of N output blocks. There is a blank line between output blocks.


Input

The input consists of single line that contains single positive integer - K.


Output

Output should contain a single line that contains single positive integer - N.



Sample Input

1

4

Sample Output

102564



--------------------------------------------------------------------------------
...全文
74 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
nobush 2004-05-03
  • 打赏
  • 举报
回复
#include<stdio.h>

int main()
{
int k;
long n,out;
printf("please input a integer between 1 and 10000: ");
scanf("%d",&k);
while(n=k,n<10)n+=k;
/*check the number*/
do{
int d;
long base=10;
while(base<=n)base*=10;
base/=10;
/*deal the first decimal digit*/
d=n/base;
out=n%base;
out=out*10+d;
if(n==out*k)
{
printf("the minimal integer is %ld\n",out);
return 0;
}
n+=k;
}while(n>=0);
printf("no marched!\n");
return 1;
}

/*================= result:======================*/
/*-
-
-
-4 —— 102564
-5 —— 714285
-
-
-
-
-10 —— 10
…… -*/
rorot 2004-04-30
  • 打赏
  • 举报
回复
那个题号?
内容概要:本文研究了基于PSCAD与MATLAB联合仿真平台的多区距离保护与智能故障定位协同方法,旨在提升高压输电线路在复杂运行条件下的保护精度与故障定位能力。研究融合全周期滑动DFT相量提取技术与Fortescue对称分量变换,构建适用于多区段输电线路的距离保护算法,并引入智能故障定位机制,实现故障区段的快速识别与精确定位。通过PSCAD进行电磁暂态建模与仿真,生成高保真故障数据,再利用MATLAB完成信号处理、保护判据计算与故障定位算法开发,充分发挥二者在高精度建模与高效算法实现方面的互补优势。研究覆盖系统建模、信号处理、保护逻辑设计、定位算法优化及联合仿真验证全流程,显著提升了距离保护的动作可靠性与故障定位的准确性。; 适合人群:具备电力系统继电保护基础知识,熟悉PSCAD和MATLAB仿真工具,从事电力系统自动化、继电保护算法开发或智能电网技术研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①应用于高压输电线路的继电保护系统设计与优化;②用于开发高精度、自适应的智能故障定位算法;③实现PSCAD与MATLAB在复杂电力系统仿真与分析中的协同应用,提升科研与工程项目的开发效率。; 阅读建议:读者应结合文中提供的仿真模型与算法代码,动手实践联合仿真流程,重点关注DFT相量提取、对称分量变换的应用以及保护与定位算法的逻辑实现,建议在PSCAD中修改故障条件,在MATLAB中调试算法参数,以深入理解方法的鲁棒性与适应性。

70,040

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧