ad 99.rs
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,7 +2,7 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
target/
|
||||
|
||||
99.htm
|
||||
wasm/pkg/
|
||||
node_modules/
|
||||
|
||||
|
||||
25
single_file_tests/99.rs
Normal file
25
single_file_tests/99.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
fn main() {
|
||||
println!("<html>");
|
||||
println!("<head><title>99</title></head>");
|
||||
println!("<body>");
|
||||
println!(r#" <table style="font-size:30px;" border="1">"#);
|
||||
println!(" <tr>");
|
||||
println!("<th></th>");
|
||||
for i in 1..=9 {
|
||||
print!("<th>{}</th>", i);
|
||||
}
|
||||
println!();
|
||||
for r in 1..=9 {
|
||||
println!(" <tr>");
|
||||
print!(r#"<th style="width:80px;">{}</th>"#, r);
|
||||
for c in 1..=9 {
|
||||
print!(r#"<td style="width:80px;text-align:center;">{}</td>"#, if c <= r { format!("{}", r * c) } else { "".into() });
|
||||
}
|
||||
println!();
|
||||
println!(" <tr>");
|
||||
}
|
||||
println!(" </table>");
|
||||
println!("</body>");
|
||||
println!("</html>");
|
||||
}
|
||||
Reference in New Issue
Block a user