#32906: ans


yp11151049@yphs.tp.edu.tw (801-24)

學校 : 臺北市私立延平高級中學
編號 : 197224
來源 : [203.72.178.1]
最後登入時間 :
2024-01-16 09:26:24
b681. 1. 山洞探險 -- 2015高雄市資訊學科能力競賽高中組 | From: [203.72.178.1] | 發表日期 : 2022-11-16 17:22

#include<bits/stdc++.h>
using namespace std;
int main(){
    int L,D;
    while(cin>>L){
        if(L<0) D=(-L)*2;
        else if(L>0) D=L*2-1;
        cout<<D<<endl;
    }
}

 
ZeroJudge Forum