#include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
if( a > 0) a = a * 2;
else a = a / 2;
cout << a;
return 0;
}
int main(){
cout.precision(10);
double a;
cin>>a;
if (a>0) a*=2; else a/=2;
cout<<a;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
if( a > 0) a = a * 2;
else a = a / 2;
cout << a;
return 0;
}
#include <iostream>
using namespace std;
int main(){
cout.precision(10);
double a;
cin>>a;
if (a>0) a*=2; else a/=2;
cout<<a;
return 0;
}