xiaoqi4487 @ 2024-10-28 12:58:26
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
using namespace std;
int main()
{
int num[11] = { 0 };
char ch;
int i = 1;
int len = 0;
int t=0;
while ((ch = getchar()) != '\n')
{
if (ch != '-')
{
len++;
num[i] = ch - '0';
i++;
}
else
t++;
}
int n = 0;
for (i = 1; i <= len; i++)
n = n + num[i] * pow(10, i-1);
if(t==0)
cout << n;
else
cout << -n;
}