This commit is contained in:
Luthics 2023-02-11 16:34:24 +08:00
parent 1a04f773cf
commit 9958f88313
7 changed files with 238 additions and 0 deletions

8
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,8 @@
{
"files.associations": {
"ostream": "cpp",
"iostream": "cpp",
"cmath": "cpp",
"*.tcc": "cpp"
}
}

View File

@ -0,0 +1,5 @@
xxx xxx xxx xxx x x x xxx xxx xxx xxx xxx xxx
x x x x x x x x x x x x x x x x x x
xxx xxx xxx xxx xxx xxx x xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
x x x x x x x x x x x x x x x x x
xxx xxx xxx xxx x x xxx xxx xxx xxx xxx xxx

View File

@ -0,0 +1,67 @@
#include <bits/stdc++.h>
using namespace std;
string numbers[10][5];
string sign[2][5];
string datas[5];
int randn(int x=0,int y=100){
return ( rand() % (y - x + 1) ) + x ;
}
string sstr(int a){
string c="";
while(a){
c+=a%10+'0';
a/=10;
}
string b = "";
for(int i=0;i<c.size();i++){
b+=c[c.size()-i-1];
}
return b;
}
int main(){
srand(time(0));
freopen("mode.txt","r",stdin);
freopen("input.txt","w",stdout);
for(int i=0;i<12;i++){
for(int j=0;j<5;j++){
if(i<10) getline(cin,numbers[i][j]);
else getline(cin,sign[i-10][j]);
// cout << numbers[i][j] << endl;
}
// cout << endl;
}
for(int i=0;i<=10;i++){
if(i%2==1){
int signx = randn(1,2);
for(int j=0;j<5;j++){
datas[j]+=sign[signx-1][j];
}
int space = randn(1,6);
for(int j=0;j<5;j++){
for(int k=0;k<space;k++) datas[j] += " ";
}
}
else {
int num = randn(1,100);
string s = sstr(num);
for(int j=0;j<s.size();j++){
for(int k=0;k<5;k++){
datas[k] += numbers[s[j]-'0'][k];
}
int space = randn(1,6);
for(int x=0;x<5;x++){
for(int k=0;k<space;k++) datas[x] += " ";
}
}
}
}
for(int j=0;j<5;j++){
cout << datas[j] << endl;
}
return 0;
}

BIN
maker.exe Normal file

Binary file not shown.

View File

@ -0,0 +1,60 @@
xxx
x x
x x
x x
xxx
x
x
x
x
x
xxx
x
xxx
x
xxx
xxx
x
xxx
x
xxx
x x
x x
xxx
x
x
xxx
x
xxx
x
xxx
xxx
x
xxx
x x
xxx
xxx
x
x
x
x
xxx
x x
xxx
x x
xxx
xxx
x x
xxx
x
xxx
x
xxx
x
xxx

97
readme.md Normal file
View File

@ -0,0 +1,97 @@
# number-recognize
## description
阿比多斯学院的智能机有一种特殊的识别系统可以识别算式。你需要复现这种识别系统的一小部分功能。可以识别出的算式中包含e123456789+-十二种符,而你需要算出算式的内容。
每个待识别算式的构成是这样的:待识别算式由五行字符串表示这些字符串由空格和小写字母x组成。多个×共同拼成0123456789+-十二种字符之一(所有字符样例在题目下方给出)。每个0123456789+-字符之间由至少一列空格分开。
## Input
五行不超过一百五十列由小写字母x和空格组成的待识别算式。过程中涉及到的量均在int范围以内。每个字符的所占区域(在字符样例部分,用小数点表示出)不会贴在一起。
## Output
一行一个整数,表示识别出的算式,经过计算得到的结果。
## Example
### Input
xxx xxx xxx xxx x x x xxx xxx xxx xxx xxx xxx
x x x x x x x x x x x x x x x x x x
xxx xxx xxx xxx xxx xxx x xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
x x x x x x x x x x x x x x x x x
xxx xxx xxx xxx x x xxx xxx xxx xxx xxx xxx
### Output
-51
## Models
```
xxx
x x
x x
x x
xxx
x
x
x
x
x
xxx
x
xxx
x
xxx
xxx
x
xxx
x
xxx
x x
x x
xxx
x
x
xxx
x
xxx
x
xxx
xxx
x
xxx
x x
xxx
xxx
x
x
x
x
xxx
x x
xxx
x x
xxx
xxx
x x
xxx
x
xxx
x
xxx
x
xxx
```

1
tempCodeRunnerFile.cpp Normal file
View File

@ -0,0 +1 @@
c