限制:1000ms 32768K
Define the function S(x) for xx is a positive integer. S(x) equals to the sum of all digit of the decimal expression of x. Please find a positive integer k that S(k∗x)%233=0.

Input Format

First line an integer T, indicates the number of test cases (T≤100). Then Each line has a single integer x(1≤x≤1000000) indicates i-th test case.

Output Format

For each test case, print an integer in a single line indicates the answer. The length of the answer should not exceed 2000. If there are more than one answer, output anyone is ok.

样例输入
1
1
样例输出

89999999999999999999999999

看来脑洞不够大。。。。

方法一:直接输出233个9。因为任何正整数乘以9的数位和都是9的倍数。。。

#include <iostream>
using namespace std; int main()
{
int T,n;
cin>>T;
while(T--){
cin>>n;
for(int i=;i<=;i++){
cout<<;
}
cout<<endl;
}
return ;
}

方法二:

当x<10时可以直接输出233个x,当1000>x>=10时,不妨设k*x=233个x,那么k=10(233个10),当1000<=x<10000,k=100(233个100),等等。手动模拟一下就懂了。

 #include <iostream>
using namespace std; int main()
{
int T,n;
cin>>T;
while(T--){
cin>>n;
int tmp=n;
int len=;
while(n){
len++;
n/=;
} if(len==){
for(int i=;i<;i++)
cout<<tmp;
}else if(len==){
for(int i=;i<;i++)
cout<<"";
}else if(len==){
for(int i=;i<;i++)
cout<<"";
}else if(len==){
for(int i=;i<;i++)
cout<<"";
}else if(len==){
for(int i=;i<;i++)
cout<<"";
}else{
for(int i=;i<;i++)
cout<<"";
}
cout<<endl;
}
return ;
}

最新文章

  1. C语言-自定义函数
  2. Java 设计模式之代理模式
  3. ionic的scroll的使用出现的问题
  4. 使用php递归计算目录大小
  5. mysql union和union all
  6. CGlib使用案例
  7. WIN7 Wireshark: There are no interfaces on which a capture can be done
  8. IPSec VPN实验
  9. C# 委托的理解
  10. Object-C 里面的animation动画效果,核心动画
  11. Bilibili/DanmakuFlameMaster: Android开源弹幕引擎&#183;烈焰弹幕使 ~ JNI source:Bilibili/NativeBitmapFactory
  12. SuperSocket基础二
  13. May 24. 2018 Week 21st Thursday
  14. 洛谷P3222 [HNOI2012]射箭(计算几何,半平面交,双端队列)
  15. mongodb中投票节点作用
  16. svn Advanced
  17. Spark学习笔记——键值对操作
  18. Java参数验证Bean Validation 框架
  19. java常用设计模式五:建造者模式
  20. JFinal 3.3 学习 -- JFinalConfig (配置web项目)

热门文章

  1. Leetcode173. Binary Search Tree Iterator二叉搜索树迭代器
  2. Leetcode105. Construct Binary Tree from Preorder and Inorder Traversal前序与中序构造二叉树
  3. 读取复杂结构的yml配置项
  4. 威胁快报|ProtonMiner挖矿蠕虫扩大攻击面,加速传播
  5. git bash 常用操作文件命令行
  6. Delphi 设计模式:《HeadFirst设计模式》Delphi7代码---状态模式[转]
  7. 学习Python笔记---if 语句
  8. 深入理解PHP类的自动载入机制方法
  9. 【python之路16】lambda表达式
  10. 编译libusb库