#30257: 簡單


11051114 (906-30洪本元)

學校 : 臺北市私立延平高級中學
編號 : 165123
來源 : [203.72.178.2]
最後登入時間 :
2024-04-30 10:32:48
b681. 1. 山洞探險 -- 2015高雄市資訊學科能力競賽高中組 | From: [122.116.141.9] | 發表日期 : 2022-05-11 17:31

#include <iostream>
using  namespace std;

int main()
{
    int a;
    cin>>a;
    if(a>0)
    cout<<2*a-1<<endl;
    if(a<0)
    cout<<(-a)*2<<endl;    
return 0;
}

 
ZeroJudge Forum