1100.Mars Numbers (20)…to be continued…
pat-al-1100
2017-02-20
之前在乙級做過一遍,但是寫的特別麻煩,這次參考書上優(yōu)化了一下因?yàn)閿?shù)的范圍不大,選擇使用map工具以及打表的方式atof:字符串轉(zhuǎn)換成浮點(diǎn)數(shù),在stdlib.h中c_str():從string轉(zhuǎn)成char數(shù)組/** * pat-al-1100 * 2017-02-20 * Cpp version * Author: fengLian_s */#include<stdio.h>#include<iostream>#include<stdlib.h>#include<map>#include<string>using namespace std;string unitDigit[13] = {"tret", "jan", "feb", "mar", "a-TBC-新聞熱點(diǎn)
疑難解答