|
|
@ -12,8 +12,8 @@ use std::io::Read;
|
|
12
|
12
|
|
|
13
|
13
|
fn parse_dimac(dimac: &str) {
|
|
14
|
14
|
let mut lines = dimac.lines();
|
|
15
|
|
let mut num_vars = 0;
|
|
16
|
|
let mut num_clauses = 0;
|
|
|
15
|
let mut num_vars;
|
|
|
16
|
let mut num_clauses;
|
|
17
|
17
|
|
|
18
|
18
|
match lines.next() {
|
|
19
|
19
|
None => { println!("Error: expected cnf description"); return }
|
|
|
@ -45,6 +45,8 @@ fn parse_dimac(dimac: &str) {
|
|
45
|
45
|
|
|
46
|
46
|
fn main() {
|
|
47
|
47
|
let input: &mut String = &mut String::new();
|
|
48
|
|
io::stdin().read_to_string(input);
|
|
49
|
|
parse_dimac(input)
|
|
|
48
|
match io::stdin().read_to_string(input) {
|
|
|
49
|
Ok(_) => { parse_dimac(input) }
|
|
|
50
|
Err(e) => { println!("Error: {}", e) }
|
|
|
51
|
}
|
|
50
|
52
|
}
|