b681 - 1. 山洞探險
⚠️ 題目內容過短,可能是圖片或 PDF。請手動補齊。
程式碼
#include <iostream>
using namespace std;
int main(){
long long int a=0;
while(cin >> a){
if(a>0){
cout << a*2-1 << endl;
}
else if(a<0){
cout << -a*2 << endl;
}
else{
cout << 0 << endl;
}
}
}