Skip to main content

Posts

Showing posts with the label 資料表示與範圍

【UVa】10055 Hashmat the Brave Warrior

英文題目 傳送門 ,中文題目 傳送門 看了看題目,解題過程有以下幾個重點 輸入輸出不會大於2^32,但是2^32本身就超過long int可以表述的範圍了,所以要用long long int,在scan跟printf要用%lld來截取跟輸出 題目說Hashmat's soldier number is never greater than his opponent.是騙人的!如果只將敵人數目-Hashmet兵將數目是不會過的...需要加入判斷式決定減數跟被減數