725
来源:互联网 发布:中科院数据云 编辑:程序博客网 时间:2024/06/03 08:03
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=666
#include<bits/stdc++.h>using namespace std;const int maxn=10010;vector<pair<int,int> > g[maxn];int main(){int a[10]={0,1,2,3,4,5,6,7,8,9};do{int d2=a[0]*10000+a[1]*1000+a[2]*100+a[3]*10+a[4];int d1=a[5]*10000+a[6]*1000+a[7]*100+a[8]*10+a[9];if((d1%d2)==0){g[d1/d2].push_back(make_pair(d1,d2));}}while(next_permutation(a,a+10));int n;cin>>n;int f=1;while(n!=0){if(!g[n].size()){f=0;cout<<"There are no solutions for "<<n<<"."<<endl;//cout<<endl;}else{for(int i=0;i<g[n].size();i++){f=0;printf("%05d / %05d = %d\n",g[n][i].first,g[n][i].second,n);}}cin>>n;if(n)cout<<endl;}return 0;}
0 0
- 725
- 725
- 725 - Division
- 725 - Division
- uva 725
- UVa 725
- uva 725
- 725 - Division
- uva 725
- 725B
- UVa 725
- UVa 725
- UVa 725
- UVA 725
- UVA 725 - Division
- UVA 725 - Division
- 逻辑推理题725
- UVa 725 - Division
- 《谷歌和亚马逊如何做产品》读书笔记之十二:胜在从容
- 136. Single Number
- Python pickle模块和joblib模块浅析
- 程序优化
- 《机器学习&&深度学习》 视频课程资源百度云下载
- 725
- gdfzoj #549 Homework of Politics(SG函数+快速幂)
- 宏与函数哪家强?
- Quicksort(int*,int,int) //快速搜索
- MQTT客户端JAVA代码----fusesource mqtt-client
- va_start可变参数函数
- iOS UIViewController生命周期8个函数
- 用VS查看程序的dll依赖项
- 【Ubuntu】搭建环境安装软件前apt-get update失败,怎么办?