Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

MTDNS - DNS

DNS

Input

N

Output

Res

Example

Input:
etc.

Output:
etc.

Được gửi lên bởi:Đặng Minh Tiến
Ngày:2017-02-03
Thời gian chạy:1s
Giới hạn mã nguồn:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:ASM32-GCC MAWK BC C NCSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D DART ELIXIR FANTOM FORTH GRV JULIA KTLN LUA NODEJS OBJC OCAML OCT PAS-FPC PIKE PROLOG PYPY3 R RACKET CHICKEN ST SQLITE SWIFT UNLAMBDA
Nguồn bài:CBHT Group

hide comments
2017-02-17 17:35:34
#include <iostream>
using namespace std;

int main() {
long n,i=0;
int a[100000000];
cin>>n;
bool check;
if (n<0) check=false;
else
check=true;
n=(n*2)/2;
while(n!=0){
i++;
a[i]=n%10;
n=n/10;
}
if (check==true){
for(int j=1;j<=i;j++)
cout<<a[j];
}
else{
if(a[1]==0){
cout<<a[2];
for(int j=3;j<=i;j++)
cout<<-a[j];
}
else{
cout<<a[1];
for(int j=2;j<=i;j++)
cout<<-a[j];
}
}
return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.