Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- #include <vector>
- class Options{
- private:
- std::string options;
- public:
- enum TYPE{};
- int getNum(){
- return options.length();
- }
- };
- class Sudoku{
- private:
- const int ROWS_NUM=16;
- const int COLS_NUM=16;
- std::vector<std::vector<Options>> grid;
- public:
- Sudoku(){
- grid.resize(ROWS_NUM);
- for(int i=0;i<ROWS_NUM;i++){
- grid[i].resize(COLS_NUM);
- }
- }
- void solve(){
- }
- void read(std::string fileName){
- std::ifstream fin(fileName);
- char c;
- for(int i=0;i<ROWS_NUM;i++){
- for(int j=0;j<COLS_NUM;j++){
- fin>>c;
- grid[i][j]=ctoi(c);
- }
- }
- fin.close();
- }
- void write(std::string fileName){
- std::ofstream fout(fileName);
- for(int i=0;i<ROWS_NUM;i++){
- for(int j=0;j<COLS_NUM;j++){
- fout<<grid[i][j];
- }
- fout<<"\n";
- }
- fout.close();
- }
- int ctoi(char c){
- if(c=='-'){
- return 0;
- } else{
- return c-64;
- }
- }
- char itoc(int i){
- if(i==0){
- return '-';
- } else{
- char c=64;
- c+=i;
- return c;
- }
- }
- };
- int main(int argc, const char * argv[]) {
- Sudoku sudoku;
- sudoku.read("input.txt");
- sudoku.solve();
- sudoku.write("output.txt");
- // std::cout<<"GGG\n";
- // char c1;
- // while(true){
- // std::cin>>c1;
- // std::cout<<sudoku.ctoi(c1)<<std::endl;
- // std::cout<<sudoku.itoc(sudoku.ctoi(c1))<<std::endl;
- // }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment