【洛谷】P1307 数字反转

题目链接:P1307

在这里插入图片描述
在这里插入图片描述

#include<iostream>
#include<cstdio>

using namespace std;

typedef long long ll;

int main()
{
	ll n;
	cin>>n;
	ll sum = 0;
	while(n)
	{
		sum = sum*10+n%10;
		n /= 10;
	}
	
	cout<<sum<<endl;
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_42815188/article/details/85158509
今日推荐