Ai
1 Star 0 Fork 0

webturing/cplusplus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
makeOutputData.cpp 1002 Bytes
一键复制 编辑 原始数据 按行查看 历史
计爱玲 提交于 2019-08-19 23:04 +08:00 . 求最小的数字拼接,排序规则是a+b<b+a
//
// Created by jal on 2019-06-03.
//
#include<bits/stdc++.h>
using namespace std;
using LL = unsigned long long;
int main(){
for(int i = 1; i <= 10; i++){
ostringstream oss;
oss << i;
istringstream iss(oss.str());
string s;
iss >> s;
string in = "data" + s + ".in", out = "data" + s + ".out";
ifstream cin(in);
ofstream cout(out);
/******make output data************/
int n, m;
cin >> n >> m;
if(n % 4 != 0 or m % 4 != 0){
cout << "no response" << endl;
}else{
vector<string>v = {"1113", "2133", "2243", "2444"};
n /= 4;
m /= 4;
for(int i = 1; i <= n; i++){
for(int k = 0; k < v.size(); k++){
for(int j = 1; j <= m; j++){
cout << v[k];
}
cout << endl;
}
}
}
/*****************/
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/webturing/cplusplus.git
git@gitee.com:webturing/cplusplus.git
webturing
cplusplus
cplusplus
master

搜索帮助