bh3
open System.Net [<EntryPoint>] let main _ = seq{1 .. 35} |> Seq.map (fun x -> async{ (new WebClient()).DownloadFile( "https://static.event.mihoyo.com/bh3_homepage/images/pic/picture/" + x.ToString().PadLeft(2, '0') + ".jpg",x.ToString().PadLeft(2, '0') + ".jpg") |> printfn "%A"}) |> Async.Parallel |> Async.RunSynchronously |> ignore 0
open System.Text.RegularExpressions open System.Net open System.IO let data = // data.txt [<EntryPoint>] let main _ = seq{for i in Regex.Matches(data,"""https:\/\/uploadstatic\.mihoyo\.com\/contentweb\/\d{8}\/\d{19}\.(png|jpg)""") -> i.Value} |> Seq.distinct |> Seq.iteri (fun i x -> (new WebClient()).DownloadFile(x, i.ToString() + Path.GetExtension(x)) |> printfn "%A") 0
bh2
open System.Text.RegularExpressions open System.Net open System.IO let data = """""" // bh2.txt [<EntryPoint>] let main _ = seq{for i in Regex.Matches(data,"""\/\/static-event\.benghuai\.com\/new_mihoyo_homepage\/images\/download\/cg\/origin\/20\d\d-\d\d-\d\d.*?\.(png|jpg)""") -> "https:" + i.Value} |> Seq.distinct |> Seq.iteri (fun i x -> (new WebClient()).DownloadFile(x, i.ToString() + Path.GetExtension(x)) |> printfn "%A") 0
other
#include <map> #include <iostream> #include <algorithm> std::map<char, char> Mmp { {'z','B'}, {'x','i'}, {'e','g'}, {'m','W'}, {'f','e'}, {'k','/'}, {'p','.'}, {'q','j'}, {'c','p'}, {'t','n'}, {'s','_'} }; int main(int argc, char* argv[]) { std::string str = "xzmexfskexxfxxcqeqcmxfeepftce"; std::transform(str.begin(), str.end(), str.begin(), [&](auto x) { return Mmp[x]; }); for (auto i = 0; i + 1 < str.length(); i+=2) { std::swap(str[i], str[i + 1]); } std::cout << str; }